diff options
author | Alan Modra <amodra@gmail.com> | 2024-04-24 09:30:24 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-04-24 09:33:03 +0930 |
commit | 122f6f14b135480b184091bf2037ea133beedc54 (patch) | |
tree | 4e901cbce3fa6e446b68e2925ef3bff1137dedcf /libctf/testsuite/libctf-regression/gzrewrite.c | |
parent | d65decae83c64c0301f8207bb0bf14ffd11f67b7 (diff) | |
download | binutils-122f6f14b135480b184091bf2037ea133beedc54.zip binutils-122f6f14b135480b184091bf2037ea133beedc54.tar.gz binutils-122f6f14b135480b184091bf2037ea133beedc54.tar.bz2 |
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.
Diffstat (limited to 'libctf/testsuite/libctf-regression/gzrewrite.c')
-rw-r--r-- | libctf/testsuite/libctf-regression/gzrewrite.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/testsuite/libctf-regression/gzrewrite.c b/libctf/testsuite/libctf-regression/gzrewrite.c index 9972220..2e679e8 100644 --- a/libctf/testsuite/libctf-regression/gzrewrite.c +++ b/libctf/testsuite/libctf-regression/gzrewrite.c @@ -114,7 +114,7 @@ main (int argc, char *argv[]) if ((b = read_gz ("tmpdir/two.gz", &b_len)) == NULL) 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"); return 1; |