summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-12-20 02:23:44 +0000
committerpeter <peter@FreeBSD.org>2001-12-20 02:23:44 +0000
commit94820fd8060f6f43089d1a3ddb8a482402e7e494 (patch)
tree8699166b6b184f29f247be841c0729b60bce8d30 /contrib
parent14771d6bc7b7b3d565489864e6dfa8ecc3940fc5 (diff)
downloadFreeBSD-src-94820fd8060f6f43089d1a3ddb8a482402e7e494.zip
FreeBSD-src-94820fd8060f6f43089d1a3ddb8a482402e7e494.tar.gz
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
Diffstat (limited to 'contrib')
-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 311806e..34169ec 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)
OpenPOWER on IntegriCloud