electron/spec/fixtures/crash-cases/node-options-parsing/index.js
trop[bot] 8a120b6b58
fix: oob string read when parsing node_options (#46248)
* fix: oob string read when parsing node_options

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: re-enable test

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: missing linux server env for tests

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2025-03-25 11:44:55 -04:00

20 lines
644 B
JavaScript

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);
}
});