This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/pr18773 created. glibc-2.22-7-gb436080
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 5 Aug 2015 13:50:09 -0000
- Subject: GNU C Library master sources branch hjl/pr18773 created. glibc-2.22-7-gb436080
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, hjl/pr18773 has been created
at b436080ecfbefeaf3d614a27dfd687f6ca56e64c (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b436080ecfbefeaf3d614a27dfd687f6ca56e64c
commit b436080ecfbefeaf3d614a27dfd687f6ca56e64c
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Aug 5 06:49:44 2015 -0700
PR 18773 test
diff --git a/string/test-strlen.c b/string/test-strlen.c
index 2c88efa..d1fe4d9 100644
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@ -132,6 +132,28 @@ do_random_tests (void)
}
}
+/* This test checks that strlen doesn't overrun string. */
+
+static void
+check1 (void)
+{
+ /* Initialize last 128 byes in buf2 to 0. The bug requires strings
+ at the end of page boundary. */
+ int max_length = 128;
+ for (int i = 1; i <= max_length; i++)
+ ((CHAR *) buf2)[page_size - i] = 0;
+
+ for (int i = 1; i <= max_length; i++)
+ {
+ FOR_EACH_IMPL (impl, 0)
+ if (CALL (impl, (CHAR *) (buf2 + page_size - i)) != 0)
+ {
+ error (0, 0, "Wrong result in function %s", impl->name);
+ ret = 1;
+ }
+ }
+}
+
int
test_main (void)
{
@@ -139,6 +161,8 @@ test_main (void)
test_init ();
+ check1 ();
+
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
printf ("\t%s", impl->name);
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources