Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: add case of bufferLength to validateOffsetLengthRead() in utils.js
In validateOffsetLengthRead(), an error message is generated if offset or length are out of range. There should also be an error message if buffer is empty, in which case it cannot write data in it. Generally this validateOffsetLengthRead() is triggered with fs.readSync(fd, buffer, offset, length, position), where if buffer is empty, the case for zero bufferLength is triggered and the corresponding message is thrown. Fixes: nodejs#21193
- Loading branch information