buffer: fix transcode for single-byte enc to ucs2#9838
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
buffer: fix transcode for single-byte enc to ucs2#9838addaleax wants to merge 1 commit intonodejs:masterfrom
addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
Fix `buffer.transcode()` for transcoding from single-byte character encodings to UCS2. These would previously perform out-of-bounds reads due to an incorrect `sizeof()` expression. Fixes: nodejs#9834
bnoordhuis
approved these changes
Nov 29, 2016
| MaybeStackBuffer<UChar> destbuf(source_length); | ||
| Converter from(fromEncoding); | ||
| const size_t length_in_chars = source_length * sizeof(*destbuf); | ||
| const size_t length_in_chars = source_length * sizeof(UChar); |
Member
Author
There was a problem hiding this comment.
The other instances of sizeof in this file use **destbuf or UChar. I’m fine with using destbuf[0] everywhere but right now I wouldn’t want to add more confusion here.
trevnorris
approved these changes
Nov 29, 2016
Member
Author
jasnell
approved these changes
Dec 5, 2016
Member
Author
|
Landed in 69b1a76 |
addaleax
added a commit
that referenced
this pull request
Dec 6, 2016
Fix `buffer.transcode()` for transcoding from single-byte character encodings to UCS2. These would previously perform out-of-bounds reads due to an incorrect `sizeof()` expression. Fixes: #9834 PR-URL: #9838 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax
added a commit
that referenced
this pull request
Dec 6, 2016
Fix `buffer.transcode()` for transcoding from single-byte character encodings to UCS2. These would previously perform out-of-bounds reads due to an incorrect `sizeof()` expression. Fixes: #9834 PR-URL: #9838 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Fishrock123
added a commit
that referenced
this pull request
Dec 6, 2016
Notable changes: * buffer: - Reverted the runtime deprecation of calling `Buffer()` without `new`. (Anna Henningsen) #9529 - Fixed `buffer.transcode()` for single-byte character encodings to `UCS2`. (Anna Henningsen) #9838 * promise: `--trace-warnings` now produces useful stacktraces for Promise warnings. (Anna Henningsen) #9525 * repl: Fixed a bug preventing correct parsing of generator functions. (Teddy Katz) #9852 * V8: Fixed a significant `instanceof` performance regression. (Franziska Hinkelmann) #9730 PR-URL: #10127
imyller
added a commit
to imyller/meta-nodejs
that referenced
this pull request
Dec 7, 2016
Notable changes:
* buffer:
- Reverted the runtime deprecation of calling `Buffer()` without
`new`. (Anna Henningsen) nodejs/node#9529
- Fixed `buffer.transcode()` for single-byte character
encodings to `UCS2`. (Anna Henningsen)
nodejs/node#9838
* promise: `--trace-warnings` now produces useful stacktraces for
Promise warnings. (Anna Henningsen)
nodejs/node#9525
* repl: Fixed a bug preventing correct parsing of generator functions.
(Teddy Katz) nodejs/node#9852
* V8: Fixed a significant `instanceof` performance regression.
(Franziska Hinkelmann) nodejs/node#9730
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
jmdarling
pushed a commit
to jmdarling/node
that referenced
this pull request
Dec 8, 2016
Fix `buffer.transcode()` for transcoding from single-byte character encodings to UCS2. These would previously perform out-of-bounds reads due to an incorrect `sizeof()` expression. Fixes: nodejs#9834 PR-URL: nodejs#9838 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Contributor
|
@addaleax this is not landing cleanly on v6.x or v4.x There are some other commits that need to get pulled for this to land cleanly, should we backport? |
Member
Author
|
@thealphanerd This affects a feature added in #9038, which exists only in v7. I’m removing the lts-watch labels here and left a comment over there, let me know if you need anything else :) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
buffer
Description of change
Fix
buffer.transcode()for transcoding from single-byte characterencodings to UCS2.
These would previously perform out-of-bounds reads due to an
incorrect
sizeof()expression.Fixes: #9834
/cc @nodejs/buffer