Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
worker: fix process.env var empty key access
PR-URL: #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>
  • Loading branch information
bl-ue authored and targos committed May 13, 2020
1 parent 98c3c42 commit 9ce6e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_env_var.cc
Expand Up @@ -210,7 +210,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());
}
Expand Down

0 comments on commit 9ce6e36

Please sign in to comment.