summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2016-06-15 12:42:52 -0400
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-07-05 22:11:44 +0200
commit962ac37e1f07f0ce36266a3156dced149b6387d1 (patch)
treec19c91cc7f2945cf00b8442633d3d2b88b2954a8 /test
parent0bbf2ef6ea75e56123ea957ac286bd9106569efa (diff)
downloadnode-new-962ac37e1f07f0ce36266a3156dced149b6387d1.tar.gz
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')
-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');