fix: oob string read when parsing node_options (#46210)
* fix: oob string read when parsing node_options * chore: re-enable test * fix: missing linux server env for tests
This commit is contained in:
parent
cfada0347e
commit
307d4f94c7
7 changed files with 51 additions and 9 deletions
20
spec/fixtures/crash-cases/node-options-parsing/index.js
vendored
Normal file
20
spec/fixtures/crash-cases/node-options-parsing/index.js
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
const { app, utilityProcess } = require('electron');
|
||||
|
||||
const path = require('node:path');
|
||||
|
||||
app.whenReady().then(() => {
|
||||
if (process.env.NODE_OPTIONS &&
|
||||
process.env.NODE_OPTIONS.trim() === '--allow-addons --allow-addons') {
|
||||
const child = utilityProcess.fork(path.join(__dirname, 'options.js'), [], {
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
NODE_OPTIONS: `--allow-addons --require ${path.join(__dirname, 'preload.js')} --enable-fips --allow-addons --enable-fips`,
|
||||
ELECTRON_ENABLE_STACK_DUMPING: 'true'
|
||||
}
|
||||
});
|
||||
|
||||
child.once('exit', (code) => code ? app.exit(1) : app.quit());
|
||||
} else {
|
||||
app.exit(1);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue