summaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-01-08 15:39:49 +0000
committerNick Clifton <nickc@redhat.com>2015-01-08 15:39:49 +0000
commit063bb0250defafcc55544474a2961ecbc153882e (patch)
tree5ec4e53c3bbc11fc7ff8dce67ccfacaad5608767 /bfd/coffcode.h
parent848cde35d61874521ad6c88a50f983d5ee7d2307 (diff)
Fix memory access violations exposed by running strip on fuzzed binaries.
PR binutils/17512 * coffcode.h (coff_slurp_symbol_table): Return false if we failed to load the line table. * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum maxpagesize of 1. * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the Data Directory Size is too large. * objcopy.c (copy_object): Free the symbol table if no symbols could be loaded. (copy_file): Use bfd_close_all_done to close files that could not be copied.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 695497f4b3..9e1c20acf3 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -5012,13 +5012,13 @@ coff_slurp_symbol_table (bfd * abfd)
#if defined(TIC80COFF) || defined(TICOFF)
case C_UEXT: /* Tentative external definition. */
#endif
- case C_EXTLAB: /* External load time label. */
- case C_HIDDEN: /* Ext symbol in dmert public lib. */
default:
(*_bfd_error_handler)
(_("%B: Unrecognized storage class %d for %s symbol `%s'"),
abfd, src->u.syment.n_sclass,
dst->symbol.section->name, dst->symbol.name);
+ case C_EXTLAB: /* External load time label. */
+ case C_HIDDEN: /* Ext symbol in dmert public lib. */
dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value);
break;
@@ -5046,7 +5046,8 @@ coff_slurp_symbol_table (bfd * abfd)
p = abfd->sections;
while (p)
{
- coff_slurp_line_table (abfd, p);
+ if (! coff_slurp_line_table (abfd, p))
+ return FALSE;
p = p->next;
}
}