Unverified Commit 4d49bcb7 authored by Anna Henningsen's avatar Anna Henningsen
Browse files

buffer: fix UCS2 indexOf for odd buffer length

Fix `buffer.indexOf` for the case that the haystack has odd length
and the needle is not found in it. `StringSearch()` would return
the length of the buffer in multiples of `sizeof(uint16_t)`, but
checking that against `haystack_length` would not work if the latter
one was odd.

PR-URL: https://github.com/nodejs/node/pull/6511


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
parent 5defa0cb
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment