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 libc/12092] strstr broken for some inputs on pre-SSE4 machines


http://sourceware.org/bugzilla/show_bug.cgi?id=12092

--- Comment #1 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2010-10-05 17:08:33 UTC ---
Additional analysis from iant@google.com:

I'm not completely sure, but this is what I see so far.  The bug can only occur
when the second argument to strstr (the needle) is periodic, which is to say
that it consists entirely of some repeated string.  When that happens, the code
can fail to match if the first argument to strstr (the haystack) contains two
or more repetitions of the needle's periodic string, but not as many as the
number of occurrences as are in the needle.  In that case strstr can sometimes
return a pointer to the smaller number of repetitions, when it should properly
return NULL or a later pointer.  Also, the needle has to be 32 bytes or more.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]