aboutsummaryrefslogtreecommitdiff
path: root/contrib/binutils/bfd
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2001-12-20 02:23:44 +0000
committerPeter Wemm <peter@FreeBSD.org>2001-12-20 02:23:44 +0000
commit855ee8c509184df8c31758b8f2ca9e9d31440489 (patch)
tree8699166b6b184f29f247be841c0729b60bce8d30 /contrib/binutils/bfd
parentadc940bfc719044f1b025222d66bed9e62c130ba (diff)
downloadsrc-855ee8c509184df8c31758b8f2ca9e9d31440489.tar.gz
src-855ee8c509184df8c31758b8f2ca9e9d31440489.zip
Fix the 'nm' -> segfault bug (on the vendor branch). This has been fixed
the same way in the cygnus base source. The problem was that bfd was writing to memory obtained from malloc(0). The next import will update this if necessary. I'm not sure of the origins of this patch. Discussed with: obrien
Notes
Notes: svn path=/vendor/binutils/dist/; revision=88237
Diffstat (limited to 'contrib/binutils/bfd')
-rw-r--r--contrib/binutils/bfd/syms.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c
index 311806e1f6b6..34169ec276e1 100644
--- a/contrib/binutils/bfd/syms.c
+++ b/contrib/binutils/bfd/syms.c
@@ -715,6 +715,8 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep)
storage = bfd_get_symtab_upper_bound (abfd);
if (storage < 0)
goto error_return;
+ if (storage == 0)
+ return 0;
syms = (asymbol **) bfd_malloc ((size_t) storage);
if (syms == NULL)