From 37e3922eed415bbedd2dd6e46308fe9e03417770 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 27 Jan 2015 11:30:15 +0000 Subject: Fix memory access violations triggered by running dlltool on corrupt binaries. PR binutils/17512 * dlltool.c (identify_search_archive): If the last archive was the same as the current archive, terminate the loop. * pdp11.c (aout_get_external_symbols): Return false if there are no symbols. --- binutils/ChangeLog | 6 ++++++ binutils/dlltool.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 5fbccc8..a017c64 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2015-01-27 Nick Clifton + + PR binutils/17512 + * dlltool.c (identify_search_archive): If the last archive was the + same as the current archive, terminate the loop. + 2015-01-23 Nick Clifton * nlmconv.c (powerpc_mangle_relocs): Fix build errors introduced diff --git a/binutils/dlltool.c b/binutils/dlltool.c index dcc4651..b5b3aff 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -3589,7 +3589,15 @@ identify_search_archive (bfd * abfd, } if (last_arfile != NULL) - bfd_close (last_arfile); + { + bfd_close (last_arfile); + /* PR 17512: file: 8b2168d4. */ + if (last_arfile == arfile) + { + last_arfile = NULL; + break; + } + } last_arfile = arfile; } -- cgit v1.1