Repository navigation
Conversation
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. Caution AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context. |
|
You have multiple unapproved PRs open at this time. To stay within the guidelines, you may de-prioritize this PR or other open PRs by setting them to draft status. |
e48e504 to
0d0512f
Compare
|
Sorry for the delay. Done: this is now a draft, and #67060 is the only PR I have under review. The commit is also signed off now. |
This comment was marked as resolved.
This comment was marked as resolved.
When chdir() fails, the error includes the original working directory from uv_cwd(), but the result of uv_cwd() was not checked. If the working directory has been removed, uv_cwd() fails and leaves the buffer unwritten, and the error reported uninitialized stack bytes as its path. Leave the path out when uv_cwd() fails. Signed-off-by: Martin Mirchev <mirchevmartin2203@gmail.com>
0d0512f to
a957d5d
Compare
|
Thanks, and sorry about that. I've rewrapped the commit message to 72 columns, and the lint check passes now. |
When
process.chdir()fails, the thrown error includes the original workingdirectory, read with
uv_cwd(). The result ofuv_cwd()was not checked: ifthe working directory has been removed,
uv_cwd()fails, the buffer is neverwritten, and the error reports uninitialized stack bytes as its
path(and inits message):
With this change the original directory is left out of the error when it
cannot be determined (
chdir -> '/nonexistent', nopath). The new test runsa child process in a removed directory and checks the error's
path,destand
message; it is skipped on Windows, where the working directory cannot beremoved.
This bug was found by an LLM-assisted static analysis tool; the fix and test were drafted with
the help of a coding agent. I reproduced the stray
pathon v22.22.2 and verified the fix onLinux (the new test fails before the change and passes after it), and ran the existing
test-process-chdir*tests, cpplint and ESLint.