Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 18 Apr 2014 18:41:46 +0200
From: Yves Bastide <>
To: musl <>
Subject: src/string/wcsstr.c doesn't work


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.


View attachment "test_wcsstr.c" of type "text/x-csrc" (283 bytes)

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.