Skip to content

fs: don't throw in read if buffer too big

Rodrigo Muino Tomonari requested to merge github/fork/evanlucas/fixreaderr into master

If the resulting buffer.toString() call in fs.read throws, catch the error and pass it back in the callback.

This issue only presents itself when fs.read is called using the legacy string interface:

fs.read(fd, length, position, encoding, callback)

R=@trevnorris, @jasnell

Related: https://github.com/nodejs/node/pull/3485

Merge request reports

Loading