Date: Thu, 24 Dec 2020 14:26:30 -0800 From: Fangrui Song <i@...kray.me> To: musl@...ts.openwall.com Subject: Re: out-of-bounds reads in strstr On Wed, Dec 9, 2020 at 8:37 AM Rich Felker <dalias@...c.org> wrote: > > On Wed, Dec 09, 2020 at 09:54:51AM +0300, Alexander Monakov wrote: > > On Tue, 8 Dec 2020, Rich Felker wrote: > > > > > > That being said. I'm still confused by the comment in strstr. `l | 63` > > > > is closer to `MAX(l,63)` than `MIN(l,63)`. > > > > > > Yes, the comment is wrong. The point is just to scan at least l bytes > > > forward for the end of the haystack (since we'll need that many > > > immediately) and at least some decent minimum to avoid doing it over > > > and over if the needle is short. But there's no need for it to be > > > precise. > > > > It's not the first time this comes up. I suspect you'd save more time > > correcting the misleading comment instead of responding to each inquiry > > individually. > > Thanks for poking me again about this. Will do. > > Rich wcsstr.c has a similar typo.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.