From 353c55748aec7796b47b68bf09cc00a0808fd4be Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 26 Jul 2007 02:01:49 +0000 Subject: [PATCH] 2007-07-25 Michael Snyder * coffgen.c (_bfd_coff_get_external_symbols): Nothing to be done if size == 0; return and avoid possible null pointer issues. --- bfd/ChangeLog | 5 +++++ bfd/coffgen.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d0f1e3f68b1..61c4ad7fba7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2007-07-25 Michael Snyder + + * coffgen.c (_bfd_coff_get_external_symbols): Nothing to be done + if size == 0; return and avoid possible null pointer issues. + 2007-07-25 Alan Modra * linker.c (generic_link_add_symbol_list): Warning fix. diff --git a/bfd/coffgen.c b/bfd/coffgen.c index 7430cf6a760..f4f97b3f0d7 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -1444,9 +1444,11 @@ _bfd_coff_get_external_symbols (bfd *abfd) symesz = bfd_coff_symesz (abfd); size = obj_raw_syment_count (abfd) * symesz; + if (size == 0) + return TRUE; syms = bfd_malloc (size); - if (syms == NULL && size != 0) + if (syms == NULL) return FALSE; if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 -- 2.30.2