readelf large memory allocation

* elfcomm.h (setup_archive): Update prototype.
	* elfcomm.c (setup_archive): Add file_size parameter and sanity
	check longnames_size.
	(setup_nested_archive): Get file size and pass to setup_archive.
	* elfedit.c (process_archive): Likewise.
	* readelf.c (process_archive): Pass filedata->file_size to
	setup_archive.
This commit is contained in:
Alan Modra 2020-03-14 11:50:22 +10:30
parent f761cb13a9
commit 780f96aed2
5 changed files with 25 additions and 7 deletions

View file

@ -20247,7 +20247,8 @@ process_archive (Filedata * filedata, bfd_boolean is_thin_archive)
nested_arch.longnames = NULL;
if (setup_archive (&arch, filedata->file_name, filedata->handle,
is_thin_archive, do_archive_index) != 0)
filedata->file_size, is_thin_archive,
do_archive_index) != 0)
{
ret = FALSE;
goto out;