This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug string/23637] Generic strstr/strcasestr fails with huge needles


https://sourceware.org/bugzilla/show_bug.cgi?id=23637

--- Comment #12 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The release/2.27/master branch has been updated by Wilco Dijkstra
<wilco@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4ec1b9e91382e66fb9a89361c93f9f560abc67f7

commit 4ec1b9e91382e66fb9a89361c93f9f560abc67f7
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.

    (cherry picked from commit 83a552b0bb9fc2a5e80a0ab3723c0a80ce1db9f2)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]