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.27.9000-38-gd92c275
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 6 Feb 2018 21:43:40 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.27.9000-38-gd92c275
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 d92c2759976600decd8353730a5b5ce30c2758d8 (commit)
from 625fb764b4d9138fe9c2cbffa1b755e8f43f6e06 (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://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d92c2759976600decd8353730a5b5ce30c2758d8
commit d92c2759976600decd8353730a5b5ce30c2758d8
Author: Joseph Myers <joseph@codesourcery.com>
Date: Tue Feb 6 21:43:20 2018 +0000
Move string/testcopy.c to test-driver.c and xmalloc (bug 19667).
Bug 19667 reports unchecked malloc calls in the test
string/testcopy.c. This patch makes that test use xmalloc and the
support/test-driver.c test framework.
Tested for x86_64.
[BZ #19667]
* string/testcopy.c: Include <support/support.h>. Do not include
<malloc.h>. Use <support/test-driver.c>.
(main): Rename to do_test. Make static. Use xmalloc instead of
malloc.
diff --git a/ChangeLog b/ChangeLog
index 15e5f2a..e19e415 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2018-02-06 Joseph Myers <joseph@codesourcery.com>
+ [BZ #19667]
+ * string/testcopy.c: Include <support/support.h>. Do not include
+ <malloc.h>. Use <support/test-driver.c>.
+ (main): Rename to do_test. Make static. Use xmalloc instead of
+ malloc.
+
[BZ #13575]
* posix/bits/posix1_lim.h: Include <bits/wordsize.h>.
[!SSIZE_MAX && !(__WORDSIZE == 64 || __WORDSIZE32_SIZE_ULONG)]
diff --git a/string/testcopy.c b/string/testcopy.c
index 61ede1c..f14917b 100644
--- a/string/testcopy.c
+++ b/string/testcopy.c
@@ -19,10 +19,10 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <malloc.h>
+#include <support/support.h>
-int
-main (void)
+static int
+do_test (void)
{
char *mem, *memp;
char *rand_mem;
@@ -34,10 +34,10 @@ main (void)
max_size = 256;
- mem = malloc (max_size + 2 * max_size + 2 * space_around);
- rand_mem = malloc (max_size);
- lo_around = malloc (space_around);
- hi_around = malloc (space_around);
+ mem = xmalloc (max_size + 2 * max_size + 2 * space_around);
+ rand_mem = xmalloc (max_size);
+ lo_around = xmalloc (space_around);
+ hi_around = xmalloc (space_around);
memp = mem + space_around;
/* Fill RAND_MEM with random bytes, each non-zero. */
@@ -105,3 +105,5 @@ main (void)
return 0;
}
+
+#include <support/test-driver.c>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
string/testcopy.c | 16 +++++++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
hooks/post-receive
--
GNU C Library master sources