You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
child_process.spawn not checking null byte in args #44768
not ok 266 parallel/test-child-process-reject-null-bytes
---
duration_ms: 0.272
severity: fail
exitcode: 1
stack: |-
node:assert:636
throw err;
^
AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
Comparison {
code: 'ERR_INVALID_ARG_VALUE',
+ message: "The argument 'args[3]' must be a string without null bytes. Received 'BBB\\x00XXX'"
- message: /The argument 'args\[2\]' must be a string without null bytes/
}
at Object.<anonymous> (/<<PKGBUILDDIR>>/test/parallel/test-child-process-reject-null-bytes.js:88:1)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'args[3]' must be a string without null bytes. Received 'BBB\x00XXX'
at new NodeError (node:internal/errors:400:5)
at validateArgumentNullCheck (node:child_process:968:11)
at validateArgumentsNullCheck (node:child_process:975:5)
at normalizeSpawnArguments (node:child_process:562:3)
at spawn (node:child_process:750:13)
at fork (node:child_process:170:10)
at throws.code (/<<PKGBUILDDIR>>/test/parallel/test-child-process-reject-null-bytes.js:88:14)
at getActual (node:assert:757:5)
at throws (node:assert:903:24)
at Object.<anonymous> (/<<PKGBUILDDIR>>/test/parallel/test-child-process-reject-null-bytes.js:88:1) {
code: 'ERR_INVALID_ARG_VALUE'
},
expected: {
code: 'ERR_INVALID_ARG_VALUE',
message: /The argument 'args\[2\]' must be a string without null bytes/
},
operator: 'throws'
}
Node.js v18.13.0
...
ok 267 parallel/test-child-process-promisified
Maybe it has something to deal with the fact that we add --openssl-shared-config to some test?
+export TEST_CI_ARGS = --node-args="--openssl-shared-config"
changing argv[2] to argv[3] seems to work as workaround, but we should have a smarter way to check if TEST_CI_ARGS have a different value other than the default...
Activity
bnoordhuis commentedon Sep 25, 2022
I agree this ought to be fixed, for consistency with node's fs module (which rejects paths with nul bytes) if nothing else. Pull request welcome.
RaisinTen commentedon Sep 25, 2022
Sent a PR which adds the required validation: #44782
child_process: validate arguments for null bytes
child_process: validate arguments for null bytes
child_process: validate arguments for null bytes
child_process: validate arguments for null bytes
LocutusOfBorg commentedon Jan 9, 2023
Hello @RaisinTen , looks like your test is not working on Ubuntu 23.04...
nodejs 18.13.0
https://launchpadlibrarian.net/644796275/buildlog_ubuntu-lunar-amd64.nodejs_18.13.0+dfsg-1ubuntu1_BUILDING.txt.gz
can you please doublecheck?
LocutusOfBorg commentedon Jan 9, 2023
Maybe it has something to deal with the fact that we add --openssl-shared-config to some test?
+export TEST_CI_ARGS = --node-args="--openssl-shared-config"
LocutusOfBorg commentedon Jan 10, 2023
changing argv[2] to argv[3] seems to work as workaround, but we should have a smarter way to check if TEST_CI_ARGS have a different value other than the default...
LocutusOfBorg commentedon Jan 10, 2023
This works as specific Ubuntu workaround.