summaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-02-15 14:37:34 +0000
committerNick Clifton <nickc@redhat.com>2013-02-15 14:37:34 +0000
commit504a4af911433852119075ab8c06506a93585473 (patch)
treebdf823f92c30e1d4d753c54137802438daaae450 /binutils/readelf.c
parent8c9877db6f511c39cf496f65dc35c1780207c418 (diff)
downloadbinutils-redhat-504a4af911433852119075ab8c06506a93585473.tar.gz
PR binutils/15140
* ar.c (open_inarch): Fail on attempts to convert a normal archive to a thin archive or vice versa. * elfcomm.c (make_qualified_name): Handle corrupted thin archives. * readelf.c (process_archive): Likewise. * doc/binutils.texi: Clarify documentation describing thin archives. * archive.c (_bfd_get_elt_at_filepos): Prevent an infinite loop accessing a corrupt nested archive.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 7710079987..c7bd05f7d5 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -13975,6 +13975,15 @@ process_archive (char * file_name, FILE * file, bfd_boolean is_thin_archive)
}
else if (is_thin_archive)
{
+ /* PR 15140: Allow for corrupt thin archives. */
+ if (nested_arch.file == NULL)
+ {
+ error (_("%s: contains corrupt thin archive: %s\n"),
+ file_name, name);
+ ret = 1;
+ break;
+ }
+
/* This is a proxy for a member of a nested archive. */
archive_file_offset = arch.nested_member_origin + sizeof arch.arhdr;