mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
worker: fix process.env var empty key access
PR-URL: https://github.com/nodejs/node/pull/32921 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
1 parent
75e4ccb192
commit
540f2785dd
1 file changed
+1
-1
+1
-1
@@ -227,7 +227,7 @@ void MapKVStore::Set(Isolate* isolate, Local<String> key, Local<String> value) {
|
||||
Mutex::ScopedLock lock(mutex_);
|
||||
Utf8Value key_str(isolate, key);
|
||||
Utf8Value value_str(isolate, value);
|
||||
if (*key_str != nullptr && *value_str != nullptr) {
|
||||
if (*key_str != nullptr && key_str.length() > 0 && *value_str != nullptr) {
|
||||
map_[std::string(*key_str, key_str.length())] =
|
||||
std::string(*value_str, value_str.length());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user