From 94820fd8060f6f43089d1a3ddb8a482402e7e494 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 20 Dec 2001 02:23:44 +0000 Subject: 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 --- contrib/binutils/bfd/syms.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib') 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) -- cgit v1.1