Skip to content

Commit 2e6e2d6

Browse files
addaleaxMylesBorins
authored andcommitted
child_process: add nullptr checks after allocs
Add `CHECK_NE(·, nullptr)` after allocations made when spawning child processes. PR-URL: #6256 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent df93d6b commit 2e6e2d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/process_wrap.cc

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class ProcessWrap : public HandleWrap {
165165
for (int i = 0; i < argc; i++) {
166166
node::Utf8Value arg(env->isolate(), js_argv->Get(i));
167167
options.args[i] = strdup(*arg);
168+
CHECK_NE(options.args[i], nullptr);
168169
}
169170
options.args[argc] = nullptr;
170171
}
@@ -186,6 +187,7 @@ class ProcessWrap : public HandleWrap {
186187
for (int i = 0; i < envc; i++) {
187188
node::Utf8Value pair(env->isolate(), env_opt->Get(i));
188189
options.env[i] = strdup(*pair);
190+
CHECK_NE(options.env[i], nullptr);
189191
}
190192
options.env[envc] = nullptr;
191193
}

0 commit comments

Comments
 (0)