diff options
author | c-childs <claire.childs@mongodb.com> | 2020-09-01 14:32:27 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-01 23:20:59 +0000 |
commit | 609bf1ddf9a2702d3bdd711b8fd49efa281a2129 (patch) | |
tree | 37c9a7b83ccc89b3f9645f36ca0a68c877436fda /src/mongo/scripting | |
parent | b5467de6410d61c77adc352df0291805df816f7d (diff) | |
download | mongo-609bf1ddf9a2702d3bdd711b8fd49efa281a2129.tar.gz |
SERVER-47391 convert strcpy to strncpy
Diffstat (limited to 'src/mongo/scripting')
-rw-r--r-- | src/mongo/scripting/mozjs/jsstringwrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/scripting/mozjs/jsstringwrapper.cpp b/src/mongo/scripting/mozjs/jsstringwrapper.cpp index bbeefc0c8a0..7f68ae6a47d 100644 --- a/src/mongo/scripting/mozjs/jsstringwrapper.cpp +++ b/src/mongo/scripting/mozjs/jsstringwrapper.cpp @@ -44,8 +44,8 @@ namespace mozjs { JSStringWrapper::JSStringWrapper(std::int32_t value) : _isSet(true) { auto formatted = fmt::format_int(value); - strcpy(_buf, formatted.c_str()); _length = formatted.size(); + strncpy(_buf, formatted.c_str(), sizeof(_buf)); } JSStringWrapper::JSStringWrapper(JSContext* cx, JSString* str) : _isSet(true) { |