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] vectorized string functions


On Wed, Jul 11, 2012 at 05:10:07PM +0200, OndÅej BÃlka wrote:
> Now I am almost done with vectorized implementation of string functions.
> I use single loop to get faster implementation of *len, *chr and *str 
> functions. 

In light of the recent strstr breakage issue (quadratic performance),
I looked at your strstr implementation. I noticed some MAJOR bugs
before I even got to looking at the algorithm (which I still haven't
done). The biggest is that you're storing the result of strlen
(size_t) into int, i.e. truncating the length to 32 bits. There are
also integer overflow issues (I saw unchecked 8*ns where ns is the
truncated string length).

In any case, before this code has any chance of being adopted, it's
going to require a major security/safety audit. The above kinds of
mistakes, well, don't inspire confidence...

Rich


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