summaryrefslogtreecommitdiff
path: root/test/parallel/test-string-decoder.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2016-06-15 12:42:52 -0400
committerBrian White <mscdex@mscdex.net>2016-06-23 23:18:10 -0400
commit79ef3b6b5df0a0c262d2472298afe023a470da68 (patch)
tree56531788217809312aae22b69e3c1388acedfe28 /test/parallel/test-string-decoder.js
parent5267f29b3445d608e2458087a5724820aa996930 (diff)
downloadandroid-node-v8-79ef3b6b5df0a0c262d2472298afe023a470da68.tar.gz
android-node-v8-79ef3b6b5df0a0c262d2472298afe023a470da68.tar.bz2
android-node-v8-79ef3b6b5df0a0c262d2472298afe023a470da68.zip
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: https://github.com/nodejs/node/issues/7308 PR-URL: https://github.com/nodejs/node/pull/7310 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Diffstat (limited to 'test/parallel/test-string-decoder.js')
-rw-r--r--test/parallel/test-string-decoder.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js
index 14933c46fc..7f1a47abcc 100644
--- a/test/parallel/test-string-decoder.js
+++ b/test/parallel/test-string-decoder.js
@@ -55,7 +55,7 @@ assert.strictEqual(decoder.write(Buffer.from('\ufffd\ufffd\ufffd')),
assert.strictEqual(decoder.end(), '');
decoder = new StringDecoder('utf8');
-assert.strictEqual(decoder.write(Buffer.from('efbfbde2', 'hex')), '\ufffd');
+assert.strictEqual(decoder.write(Buffer.from('EFBFBDE2', 'hex')), '\ufffd');
assert.strictEqual(decoder.end(), '\ufffd');