forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: add empty buffer case to read and readSync function in fs
While using read() or readSync() function, it should be verified that the arguments of the function are in proper range and hold legitimate values, for a successful read process. For this validateOffsetLengthRead() function is called, which gives an error message for offset and length passed by the user, if not in order. But there should also be an error when an empty buffer is passed as argument, when it cannot be written over. The empty buffer case should be checked before calling validateOffsetLengthRead() and ERR_INVALID_ARG_VALUE should be thrown corresponding to the empty buffer argument in read and readSync function. Fixes: nodejs#21193
- Loading branch information
1 parent
7c1d365
commit 8043755
Showing
4 changed files
with
20 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters