aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/pwritev2.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2018-09-19 16:50:18 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2018-09-21 12:09:38 +0100
commit0ef2f4400c06927af34c515555f68840a70ba409 (patch)
tree1656859044b6ea40520a4078581e7f81e0426be7 /sysdeps/unix/sysv/linux/pwritev2.c
parenta55e109709af55e6ed67d3f9536cac5d929c982e (diff)
downloadglibc-0ef2f4400c06927af34c515555f68840a70ba409.tar
glibc-0ef2f4400c06927af34c515555f68840a70ba409.tar.gz
glibc-0ef2f4400c06927af34c515555f68840a70ba409.tar.bz2
glibc-0ef2f4400c06927af34c515555f68840a70ba409.zip
Fix strstr bug with huge needles (bug 23637)
The generic strstr in GLIBC 2.28 fails to match huge needles. The optimized AVAILABLE macro reads ahead a large fixed amount to reduce the overhead of repeatedly checking for the end of the string. However if the needle length is larger than this, two_way_long_needle may confuse this as meaning the end of the string and return NULL. This is fixed by adding the needle length to the amount to read ahead. [BZ #23637] * string/test-strstr.c (pr23637): New function. (test_main): Add tests with longer needles. * string/strcasestr.c (AVAILABLE): Fix readahead distance. * string/strstr.c (AVAILABLE): Likewise. (cherry picked from commit 83a552b0bb9fc2a5e80a0ab3723c0a80ce1db9f2)
Diffstat (limited to 'sysdeps/unix/sysv/linux/pwritev2.c')
0 files changed, 0 insertions, 0 deletions