{{ message }}
Commit a550ddb
buffer: fix needle length misestimation for UCS2
Use `StringBytes::Size` to determine the needle string length
instead of assuming latin-1 or UTF-8.
Previously, `Buffer.indexOf` could fail with an assertion failure
when the needle's byte length, but not its character count,
exceeded the haystack's byte length.
PR-URL: #6511
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>1 parent 6fc20c5 commit a550ddb
2 files changed
Lines changed: 8 additions & 2 deletions

0 commit comments