aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-07-26 02:01:49 +0000
committerMichael Snyder <msnyder@vmware.com>2007-07-26 02:01:49 +0000
commit353c55748aec7796b47b68bf09cc00a0808fd4be (patch)
treef0f04f321dfcc7f00bfa6a8fc8c8176049b5cab8 /bfd/coffgen.c
parentd429448cf8b93f302665bbd5303e06c61a7e6146 (diff)
downloadgdb-353c55748aec7796b47b68bf09cc00a0808fd4be.zip
gdb-353c55748aec7796b47b68bf09cc00a0808fd4be.tar.gz
gdb-353c55748aec7796b47b68bf09cc00a0808fd4be.tar.bz2
2007-07-25 Michael Snyder <msnyder@access-company.com>
* coffgen.c (_bfd_coff_get_external_symbols): Nothing to be done if size == 0; return and avoid possible null pointer issues.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 7430cf6..f4f97b3 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