mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-14 21:28:57 +08:00
buffer overflow in libctf tests
* testsuite/libctf-regression/gzrewrite.c (main): Don't overflow
"a" buffer in "after adding types" check.
* testsuite/libctf-regression/zrewrite.c (main): Likewise.
This commit is contained in:
@@ -114,7 +114,7 @@ main (int argc, char *argv[])
|
|||||||
if ((b = read_gz ("tmpdir/two.gz", &b_len)) == NULL)
|
if ((b = read_gz ("tmpdir/two.gz", &b_len)) == NULL)
|
||||||
goto read_err;
|
goto read_err;
|
||||||
|
|
||||||
if (memcmp (a, b, b_len) == 0)
|
if (a_len == b_len && memcmp (a, b, b_len) == 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "gzwrites after adding types does not change the dict\n");
|
fprintf (stderr, "gzwrites after adding types does not change the dict\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
b = read_file ("tmpdir/two", &b_len);
|
b = read_file ("tmpdir/two", &b_len);
|
||||||
|
|
||||||
if (memcmp (a, b, b_len) == 0)
|
if (a_len == b_len && memcmp (a, b, b_len) == 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "compress_writes after adding types does not change the dict\n");
|
fprintf (stderr, "compress_writes after adding types does not change the dict\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user