This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.12-177-g67a67b9
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 6 Oct 2010 17:49:09 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.12-177-g67a67b9
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 67a67b950be9741a4cf1ff3e75572204b06bec2e (commit)
via 5fb308bca2f333dcc835945be85e165cd7843d5b (commit)
from 1c375652919fb4482ae946d1cd612fa655429e11 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=67a67b950be9741a4cf1ff3e75572204b06bec2e
commit 67a67b950be9741a4cf1ff3e75572204b06bec2e
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Oct 6 13:48:51 2010 -0400
Add test case for strstr problem.
diff --git a/ChangeLog b/ChangeLog
index dacd023..55ca6b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-06 Ulrich Drepper <drepper@gmail.com>
+
+ * string/bug-strstr1.c: New file.
+ * string/Makefile: Add rules to build and run bug-strstr1.
+
2010-10-05 Eric Blake <eblake@redhat.com>
[BZ #12092]
diff --git a/string/Makefile b/string/Makefile
index cc2da10..19130dd 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -55,7 +55,8 @@ tests := tester inl-tester noinl-tester testcopy test-ffs \
bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
bug-strtok1 $(addprefix test-,$(strop-tests)) \
- bug-envz1 tst-strxfrm2 tst-endian tst-svc2
+ bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \
+ bug-strstr1
distribute := memcopy.h pagecopy.h tst-svc.expect test-string.h \
str-two-way.h
@@ -74,6 +75,7 @@ CFLAGS-tst-strlen.c = -fno-builtin
CFLAGS-stratcliff.c = -fno-builtin
CFLAGS-test-ffs.c = -fno-builtin
CFLAGS-tst-inlcall.c = -fno-builtin
+CFLAGS-bug-strstr1.c = -fno-builtin
ifeq ($(cross-compiling),no)
tests: $(objpfx)tst-svc.out
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5fb308bca2f333dcc835945be85e165cd7843d5b
commit 5fb308bca2f333dcc835945be85e165cd7843d5b
Author: Eric Blake <eblake@redhat.com>
Date: Wed Oct 6 13:48:07 2010 -0400
Fix strstr and memmem algorithm.
diff --git a/ChangeLog b/ChangeLog
index faf2bef..dacd023 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-05 Eric Blake <eblake@redhat.com>
+
+ [BZ #12092]
+ * string/str-two-way.h (two_way_long_needle): Always clear memory
+ when skipping input due to the shift table.
+
2010-10-03 Ulrich Drepper <drepper@gmail.com>
[BZ #12005]
diff --git a/string/bug-strstr1.c b/string/bug-strstr1.c
new file mode 100644
index 0000000..889de12
--- /dev/null
+++ b/string/bug-strstr1.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <string.h>
+
+int main (int argc, char** argv)
+{
+ const char haystack[] =
+ "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";
+
+ const char needle[] =
+ "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
+
+ const char* sub = strstr (haystack, needle);
+
+ if (sub != NULL)
+ {
+ int j;
+
+ fprintf (stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
+ for (j = 0; needle[j] != '\0'; ++j)
+ putchar (needle[j] == sub[j] ? ' ' : '^');
+ puts ("");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/string/str-two-way.h b/string/str-two-way.h
index 502af47..76044b3 100644
--- a/string/str-two-way.h
+++ b/string/str-two-way.h
@@ -350,8 +350,8 @@ two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
a byte out of place, there can be no match until
after the mismatch. */
shift = needle_len - period;
- memory = 0;
}
+ memory = 0;
j += shift;
continue;
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 +++++++++++
string/Makefile | 4 +++-
string/bug-strstr1.c | 26 ++++++++++++++++++++++++++
string/str-two-way.h | 2 +-
4 files changed, 41 insertions(+), 2 deletions(-)
create mode 100644 string/bug-strstr1.c
hooks/post-receive
--
GNU C Library master sources