Fix use-after-free error when parsing a corrupt nested archive.
authorNick Clifton <nickc@redhat.com>
Wed, 19 Jul 2017 13:49:12 +0000 (14:49 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 19 Jul 2017 13:49:12 +0000 (14:49 +0100)
commit909e4e716c4d77e33357bbe9bc902bfaf2e1af24
treec406acbf9c4e7a7d0978266414275e57dcc16a40
parent62a5222fdab2acdc129b7c7d3713e7f349e26029
Fix use-after-free error when parsing a corrupt nested archive.

PR 21787
* archive.c (bfd_generic_archive_p): If the bfd does not have the
correct magic bytes at the start, set the error to wrong format
and clear the format selector before returning NULL.
bfd/ChangeLog
bfd/archive.c