From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4693 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: src/string/strstr.c, src/string/wcsstr.c: wrong estimates for MIN(l,63)? Date: Fri, 21 Mar 2014 12:48:17 -0400 Message-ID: <20140321164817.GJ26358@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1395420505 27743 80.91.229.3 (21 Mar 2014 16:48:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2014 16:48:25 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4697-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 21 17:48:34 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WR2cS-0004PK-LP for gllmg-musl@plane.gmane.org; Fri, 21 Mar 2014 17:48:32 +0100 Original-Received: (qmail 11362 invoked by uid 550); 21 Mar 2014 16:48:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11348 invoked from network); 21 Mar 2014 16:48:31 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4693 Archived-At: On Fri, Mar 21, 2014 at 03:07:22PM +0100, Yves Bastide wrote: > Hi, > > twoway_strstr and twoway_wcsstr seem to contain a bogus estimation: > > /* Fast estimate for MIN(l,63) */ > size_t grow = l | 63; > > "grow" is thus always at least 63... If you look at how grow is used on the very next line, this should make sense. Rich