buffer: fix odd UTF-16LE indexOf start · nodejs/node@f7d3d11 · GitHub
Skip to content

Commit f7d3d11

Browse files
inoway46aduh95
authored andcommitted
buffer: fix odd UTF-16LE indexOf start
UTF-16LE string searches rounded odd forward start offsets down, allowing a match before the requested range. Round the start up to the next code-unit boundary while leaving reverse search and the existing 16-bit implementation unchanged. Assisted-by: Codex Signed-off-by: inoway46 <inoueyuya416@gmail.com> PR-URL: #65960 Fixes: #26448 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1fef8f5 commit f7d3d11

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/node_buffer.cc‎

Lines changed: 4 additions & 0 deletions

‎test/parallel/test-buffer-indexof.js‎

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)