Skip to content

buffer: fix transcode for single-byte enc to ucs2

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

buffer

Description of change

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: https://github.com/nodejs/node/issues/9834

/cc @nodejs/buffer

Merge request reports

Loading