aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2013-02-15 14:37:39 +0000
committerNick Clifton <nickc@redhat.com>2013-02-15 14:37:39 +0000
commita043396b72d17ae87267b534aa98457a0702f5c8 (patch)
tree01175912495c045c25625c8048a83ba65c3a5c64 /binutils/readelf.c
parent76d8cf45bb12ae6d8fc41d92579a2e166efb5b2f (diff)
downloadgdb-a043396b72d17ae87267b534aa98457a0702f5c8.zip
gdb-a043396b72d17ae87267b534aa98457a0702f5c8.tar.gz
gdb-a043396b72d17ae87267b534aa98457a0702f5c8.tar.bz2
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 7710079..c7bd05f 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;