mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
string/test-memcpy error reporting
http://sourceware.org/ml/libc-alpha/2013-08/msg00094.html Using plain %s here runs the risk of segfaulting when displaying the string. src and dst aren't zero terminated strings. * string/test-memcpy.c (do_one_test): When reporting errors, print string address and don't overrun end of string.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2013-10-04 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
|
* string/test-memcpy.c (do_one_test): When reporting errors, print
|
||||||
|
string address and don't overrun end of string.
|
||||||
|
|
||||||
2013-10-04 Alan Modra <amodra@gmail.com>
|
2013-10-04 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* sysdeps/powerpc/powerpc64/power7/memchr.S: Replace rlwimi with
|
* sysdeps/powerpc/powerpc64/power7/memchr.S: Replace rlwimi with
|
||||||
|
@ -63,8 +63,8 @@ do_one_test (impl_t *impl, char *dst, const char *src,
|
|||||||
|
|
||||||
if (memcmp (dst, src, len) != 0)
|
if (memcmp (dst, src, len) != 0)
|
||||||
{
|
{
|
||||||
error (0, 0, "Wrong result in function %s dst \"%s\" src \"%s\"",
|
error (0, 0, "Wrong result in function %s dst %p \"%.*s\" src %p \"%.*s\" len %zu",
|
||||||
impl->name, dst, src);
|
impl->name, dst, (int) len, dst, src, (int) len, src, len);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user