This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug string/23637] Generic strstr/strcasestr fails with huge needles
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 19 Sep 2018 15:52:37 +0000
- Subject: [Bug string/23637] Generic strstr/strcasestr fails with huge needles
- Auto-submitted: auto-generated
- References: <bug-23637-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=23637
--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 83a552b0bb9fc2a5e80a0ab3723c0a80ce1db9f2 (commit)
from d734727837b5135c4c4c540d8c53e5a06aa7556a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83a552b0bb9fc2a5e80a0ab3723c0a80ce1db9f2
commit 83a552b0bb9fc2a5e80a0ab3723c0a80ce1db9f2
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date: Wed Sep 19 16:50:18 2018 +0100
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.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 ++++++++
string/strcasestr.c | 5 +++--
string/strstr.c | 5 +++--
string/test-strstr.c | 30 ++++++++++++++++++++++++++++++
4 files changed, 44 insertions(+), 4 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.