GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: CHECK() for argument overflow in Spawn() · nodejs/node@bce5db2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • process_wrap.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/process_wrap.cc‎

Copy file name to clipboardExpand all lines: src/process_wrap.cc
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ class ProcessWrap : public HandleWrap {
185185
if (!argv_v.IsEmpty() && argv_v->IsArray()) {
186186
Local<Array> js_argv = Local<Array>::Cast(argv_v);
187187
int argc = js_argv->Length();
188+
CHECK_GT(argc + 1, 0); // Check for overflow.
189+
188190
// Heap allocate to detect errors. +1 is for nullptr.
189191
options.args = new char*[argc + 1];
190192
for (int i = 0; i < argc; i++) {
@@ -211,6 +213,7 @@ class ProcessWrap : public HandleWrap {
211213
if (!env_v.IsEmpty() && env_v->IsArray()) {
212214
Local<Array> env_opt = Local<Array>::Cast(env_v);
213215
int envc = env_opt->Length();
216+
CHECK_GT(envc + 1, 0); // Check for overflow.
214217
options.env = new char*[envc + 1]; // Heap allocated to detect errors.
215218
for (int i = 0; i < envc; i++) {
216219
node::Utf8Value pair(env->isolate(),

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.