Skip to content

fs(read(fd[, options], callback)): throw ERR_INVALID_ARG_TYPE when options.buffer is null#44769

Merged
nodejs-github-bot merged 3 commits intonodejs:mainfrom
wafuwafu13:validate-buffer
Sep 28, 2022
Merged

fs(read(fd[, options], callback)): throw ERR_INVALID_ARG_TYPE when options.buffer is null#44769
nodejs-github-bot merged 3 commits intonodejs:mainfrom
wafuwafu13:validate-buffer

Conversation

@wafuwafu13
Copy link

when params is { buffer: null }, buffer is not initialized with Buffer.alloc(16384). so error message became not user-friendly as seen in test case.

node/lib/fs.js

Line 621 in abfeed8

({ buffer = Buffer.alloc(16384) } = params ?? kEmptyObject);

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants