[binutils-gdb] alpha-ecoff: check archive element size
Alan Modra
amodra@sourceware.org
Mon Oct 6 11:22:56 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c7b19c486012e1dd2a10434f1891c86b1398419a
commit c7b19c486012e1dd2a10434f1891c86b1398419a
Author: Alan Modra <amodra@gmail.com>
Date: Mon Oct 6 20:56:56 2025 +1030
alpha-ecoff: check archive element size
If we run out of file before decompression finishes, the archive is
broken. Don't allow the buffer to be returned with uninitialised data.
* coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Return an
error if the full element size can't be decompressed.
Diff:
---
bfd/coff-alpha.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index fcc8aef6673..9a621e93c5b 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -2204,6 +2204,8 @@ alpha_ecoff_get_elt_at_filepos (bfd *archive, file_ptr filepos,
if (left == 0)
break;
}
+ if (left != 0)
+ goto error_return;
}
/* Now the uncompressed file contents are in buf. */
More information about the Binutils-cvs
mailing list