From 588ecbb12b0afc401090660dd03f267d184c1f18 Mon Sep 17 00:00:00 2001 From: msnyder Date: Fri, 27 Jul 2007 19:04:38 +0000 Subject: [PATCH] 2007-07-27 Michael Snyder * aoutx.h (slurp_symbol_table): Return if count == 0. --- bfd/ChangeLog | 2 ++ bfd/aoutx.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 979d845367..3b4677dc61 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,7 @@ 2007-07-27 Michael Snyder + * aoutx.h (slurp_symbol_table): Return if count == 0. + * coffgen.c (_bfd_coff_read_internal_relocs): Return if count is zero. * elf32-i386.c (elf_i386_check_relocs): Check for null pointer. diff --git a/bfd/aoutx.h b/bfd/aoutx.h index e07d7bef39..af7d45be3a 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1739,9 +1739,12 @@ NAME (aout, slurp_symbol_table) (bfd *abfd) return FALSE; cached_size = obj_aout_external_sym_count (abfd); + if (cached_size == 0) + return TRUE; /* Nothing to do. */ + cached_size *= sizeof (aout_symbol_type); cached = bfd_zmalloc (cached_size); - if (cached == NULL && cached_size != 0) + if (cached == NULL) return FALSE; /* Convert from external symbol information to internal. */ -- 2.11.0