string_decoder: fix bad utf8 character handling · nodejs/node@962ac37 · GitHub
Skip to content

Commit 962ac37

Browse files
mscdexFishrock123
authored andcommitted
string_decoder: fix bad utf8 character handling
This commit fixes an issue when extra utf8 continuation bytes appear at the end of a chunk of data, causing miscalculations to be made when checking how many bytes are needed to decode a complete character. Fixes: #7308 PR-URL: #7310 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
1 parent 0bbf2ef commit 962ac37

2 files changed

Lines changed: 62 additions & 15 deletions

File tree

lib/string_decoder.js

Lines changed: 61 additions & 14 deletions

test/parallel/test-string-decoder.js

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)