diff options
author | cjihrig <cjihrig@gmail.com> | 2018-01-13 00:30:28 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2018-01-17 09:05:52 -0500 |
commit | 1e802539b2811f5090281cfc8041f21120c2c3c6 (patch) | |
tree | 12c0556043623b1bf1dacf01731dc51641b91c34 /doc | |
parent | db9c556f507ea2510a603ca526d6cd1e79cfac2d (diff) | |
download | android-node-v8-1e802539b2811f5090281cfc8041f21120c2c3c6.tar.gz android-node-v8-1e802539b2811f5090281cfc8041f21120c2c3c6.tar.bz2 android-node-v8-1e802539b2811f5090281cfc8041f21120c2c3c6.zip |
buffer: throw when filling with empty buffers
Prior to this commit, Node would enter an infinite loop when
attempting to fill a non-zero length buffer with a zero length
buffer. This commit introduces a thrown exception in this scenario.
PR-URL: https://github.com/nodejs/node/pull/18129
Fixes: https://github.com/nodejs/node/issues/18128
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/buffer.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md index f1d3cab666..767d7e2aa8 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -519,6 +519,10 @@ changes: pr-url: https://github.com/nodejs/node/pull/17427 description: Specifying an invalid string for `fill` triggers a thrown exception. + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/18129 + description: Attempting to fill a non-zero length buffer with a zero length + buffer triggers a thrown exception. --> * `size` {integer} The desired length of the new `Buffer`. @@ -1231,6 +1235,10 @@ changes: pr-url: https://github.com/nodejs/node/pull/17427 description: Specifying an invalid string for `value` triggers a thrown exception. + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/18129 + description: Attempting to fill a non-zero length buffer with a zero length + buffer triggers a thrown exception. --> * `value` {string|Buffer|integer} The value to fill `buf` with. |