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.
This commit is contained in:
Alan Modra
2025-10-06 20:56:56 +10:30
parent b05d1d8960
commit c7b19c4860

View File

@@ -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. */