Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140418214932.GO26358@brightrain.aerifal.cx>
Date: Fri, 18 Apr 2014 17:49:32 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: src/string/wcsstr.c doesn't work

On Fri, Apr 18, 2014 at 06:41:46PM +0200, Yves Bastide wrote:
> Hi,
> 
> twoway_wcsstr doesn't (always) work with periodic needles. With the
> attached example
> 
> haystack = L"playing play play play always";
> needle = L"play play play";
> 
> mem0 = 9, ms = 3; thus, after a left-half mismatch on "playing", mem is 9 and
>     for (k = ms + 1; k>mem && n[k - 1] == h[k - 1]; k--);
> terminates immediately.

Thanks! Immediate termination of this loop is correct, but the
subsequent conditional should have been treating it as success rather
than failure. Fix committed.

Rich

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.