diff options
author | Nathan Brown <nathan.brown@10gen.com> | 2019-06-06 10:39:58 -0400 |
---|---|---|
committer | Nathan Brown <nathan.brown@10gen.com> | 2019-06-27 10:04:18 -0400 |
commit | 0fefcf84347a2bcc4961baec0295b9d04047d86f (patch) | |
tree | ce86921e5b14ee83a00400f4f4e8712093505cb8 /src/mongo/shell | |
parent | a700238800aa2bf1e10c255337ec35373ffd2667 (diff) | |
download | mongo-0fefcf84347a2bcc4961baec0295b9d04047d86f.tar.gz |
SERVER-7143 replace standard library number parsing with custom NumberParser
Diffstat (limited to 'src/mongo/shell')
-rw-r--r-- | src/mongo/shell/shell_utils_launcher.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/shell/shell_utils_launcher.cpp b/src/mongo/shell/shell_utils_launcher.cpp index 60a78f9a38d..8cdedda01e6 100644 --- a/src/mongo/shell/shell_utils_launcher.cpp +++ b/src/mongo/shell/shell_utils_launcher.cpp @@ -314,7 +314,8 @@ ProgramRunner::ProgramRunner(const BSONObj& args, const BSONObj& env, bool isMon if (str == "--port") { _port = -2; } else if (_port == -2) { - _port = strtol(str.c_str(), nullptr, 10); + if (!NumberParser::strToAny(10)(str, &_port).isOK()) + _port = 0; // same behavior as strtol } else if (isMongodProgram && str == "--configsvr") { _name = "c"; } |