summaryrefslogtreecommitdiff
path: root/src/string_search.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-05-02 03:52:46 +0200
committerAnna Henningsen <anna@addaleax.net>2016-05-04 22:14:23 +0200
commit55b975d402a796ab5dcd8efe903646f58438054e (patch)
tree9485e4fab2578dd953305221471b50e07f703048 /src/string_search.h
parentbfe645d1f47c527ced252a6303b5e30bb8c3d6f6 (diff)
downloadandroid-node-v8-55b975d402a796ab5dcd8efe903646f58438054e.tar.gz
android-node-v8-55b975d402a796ab5dcd8efe903646f58438054e.tar.bz2
android-node-v8-55b975d402a796ab5dcd8efe903646f58438054e.zip
buffer: fix lastIndexOf crash for overlong needle
Return -1 in `Buffer.lastIndexOf` if the needle is longer than the haystack. The previous check only tested the corresponding condition for forward searches. This applies only to Node.js v6, as `lastIndexOf` was added in it. Fixes: https://github.com/nodejs/node/issues/6510 PR-URL: https://github.com/nodejs/node/pull/6511 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src/string_search.h')
0 files changed, 0 insertions, 0 deletions