aboutsummaryrefslogtreecommitdiff
path: root/bfd/format.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-12-16 14:17:15 +0000
committerNick Clifton <nickc@redhat.com>2014-12-16 14:17:15 +0000
commit033539e2685156ad6ad60e5925bc61cef5ced483 (patch)
treeacdba5d5519157286fb6d5767b9690032f84f5e3 /bfd/format.c
parentbeed38b8273fa18be574a7e84d5d2ee1f563ed48 (diff)
downloadfsf-binutils-gdb-033539e2685156ad6ad60e5925bc61cef5ced483.zip
fsf-binutils-gdb-033539e2685156ad6ad60e5925bc61cef5ced483.tar.gz
fsf-binutils-gdb-033539e2685156ad6ad60e5925bc61cef5ced483.tar.bz2
Fix a memory access violation triggeed by a fuzzed binary.
PR binutils/17512 * format.c (bfd_check_format_matches): Check for a matching vector before using match priorities. * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Fix off-by-one errors with previous delta.
Diffstat (limited to 'bfd/format.c')
-rw-r--r--bfd/format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/format.c b/bfd/format.c
index c4bc944..f0d1e66 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -402,7 +402,7 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
/* We still have more than one equally good match, and at least some
of the targets support match priority. Choose the first of the
best matches. */
- if (match_count > 1 && best_count != match_count)
+ if (matching_vector && match_count > 1 && best_count != match_count)
{
int i;