1 2010-10-06 Ulrich Drepper <drepper@gmail.com>
3 * string/bug-strstr1.c: New file.
4 * string/Makefile: Add rules to build and run bug-strstr1.
6 2010-10-05 Eric Blake <eblake@redhat.com>
9 * string/str-two-way.h (two_way_long_needle): Always clear memory
10 when skipping input due to the shift table.
12 Index: glibc-2.12-2-gc4ccff1/string/Makefile
13 ===================================================================
14 --- glibc-2.12-2-gc4ccff1.orig/string/Makefile
15 +++ glibc-2.12-2-gc4ccff1/string/Makefile
16 @@ -54,7 +54,8 @@ tests := tester inl-tester noinl-tester
17 bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
18 tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
19 bug-strtok1 $(addprefix test-,$(strop-tests)) \
20 - bug-envz1 tst-strxfrm2 tst-endian tst-svc2
21 + bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \
23 distribute := memcopy.h pagecopy.h tst-svc.expect test-string.h \
26 @@ -73,6 +74,7 @@ CFLAGS-tst-strlen.c = -fno-builtin
27 CFLAGS-stratcliff.c = -fno-builtin
28 CFLAGS-test-ffs.c = -fno-builtin
29 CFLAGS-tst-inlcall.c = -fno-builtin
30 +CFLAGS-bug-strstr1.c = -fno-builtin
32 ifeq ($(cross-compiling),no)
33 tests: $(objpfx)tst-svc.out
34 Index: glibc-2.12-2-gc4ccff1/string/bug-strstr1.c
35 ===================================================================
37 +++ glibc-2.12-2-gc4ccff1/string/bug-strstr1.c
42 +int main (int argc, char** argv)
44 + const char haystack[] =
45 + "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
47 + const char needle[] =
48 + "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
50 + const char* sub = strstr (haystack, needle);
56 + fprintf (stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
57 + for (j = 0; needle[j] != '\0'; ++j)
58 + putchar (needle[j] == sub[j] ? ' ' : '^');
65 Index: glibc-2.12-2-gc4ccff1/string/str-two-way.h
66 ===================================================================
67 --- glibc-2.12-2-gc4ccff1.orig/string/str-two-way.h
68 +++ glibc-2.12-2-gc4ccff1/string/str-two-way.h
69 @@ -350,8 +350,8 @@ two_way_long_needle (const unsigned char
70 a byte out of place, there can be no match until
71 after the mismatch. */
72 shift = needle_len - period;