This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

symbol reader tweak


FreeBSD now returns a pointer to a PROT_NONE page for allocations
of size zero.  This catches bogus dereferences of this pointer.

Applied to mainline.


r~


        * syms.c (_bfd_generic_read_minisymbols): Early return for
        no symbols.  Patch from FreeBSD folk; exact origin unknown.

Index: syms.c
===================================================================
RCS file: /cvs/src/src/bfd/syms.c,v
retrieving revision 1.14
diff -u -p -r1.14 syms.c
--- syms.c	2001/09/19 05:33:13	1.14
+++ syms.c	2001/12/12 19:03:12
@@ -715,6 +715,8 @@ _bfd_generic_read_minisymbols (abfd, dyn
     storage = bfd_get_symtab_upper_bound (abfd);
   if (storage < 0)
     goto error_return;
+  if (storage == 0)
+    return 0;
 
   syms = (asymbol **) bfd_malloc ((bfd_size_type) storage);
   if (syms == NULL)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]