sea: avoid dangling CLI option pointers · nodejs/node@f32a863 · GitHub
Skip to content

Commit f32a863

Browse files
Archkonaduh95
authored andcommitted
sea: avoid dangling CLI option pointers
Reserve exec argv storage before inserting configured and CLI-expanded arguments so vector reallocation cannot invalidate pointers in argv. Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com> PR-URL: #64755 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 3126ce5 commit f32a863

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/node_sea.cc

Lines changed: 3 additions & 2 deletions

test/fixtures/sea/exec-argv-extension-cli/sea-config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
"main": "sea.js",
33
"output": "sea-prep.blob",
44
"disableExperimentalSEAWarning": true,
5-
"execArgv": ["--no-warnings"],
65
"execArgvExtension": "cli"
76
}

test/fixtures/sea/exec-argv-extension-cli/sea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const assert = require('assert');
33
console.log('process.argv:', JSON.stringify(process.argv));
44
console.log('process.execArgv:', JSON.stringify(process.execArgv));
55

6-
// Should have execArgv from SEA config + CLI --node-options
6+
// Should have all options from CLI --node-options
77
assert.deepStrictEqual(process.execArgv, ['--no-warnings', '--max-old-space-size=1024']);
88

99
assert.deepStrictEqual(process.argv.slice(2), [

test/sea/test-single-executable-application-exec-argv-extension-cli.js

Lines changed: 5 additions & 1 deletion

0 commit comments

Comments
 (0)