This is the mail archive of the libc-alpha@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]

Re: [PATCH] Fix strstr bug with huge needles (bug 23637)


On Wed, Sep 12, 2018 at 6:01 AM, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
> As reported in https://sourceware.org/ml/libc-help/2018-09/msg00000.html ,
> 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.
>
> Passes GLIBC regress on AArch64, new testcase now passes.
>
> ChangeLog:
> 2018-06-30  Wilco Dijkstra  <wdijkstr@arm.com>
>
>         [BZ #21286]
>         * string/Makefile: Add bug-strstr1.
>         * string/bug-strstr1.c: New test.

Please add the new test to test-strstr.c so that all implementations
will be tested.


-- 
H.J.


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