Skip to content

buffer: do not affect memory after target for utf16 write

Rodrigo Muino Tomonari requested to merge github/fork/addaleax/fix-26422 into master

Do not write one character too much before shifting the whole result to the left when using UTF16-LE, possibly overwriting already-used memory while doing so.

Fixes: https://github.com/nodejs/node/issues/26422

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Merge request reports

Loading