This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] coffgen.c, degenerate case
- From: DJ Delorie <dj at redhat dot com>
- To: msnyder at sonic dot net
- Cc: binutils at sourceware dot org
- Date: Wed, 25 Jul 2007 21:49:35 -0400
- Subject: Re: [patch] coffgen.c, degenerate case
- References: <9013.12.7.175.2.1185406480.squirrel@webmail.sonic.net> <xnfy3c557p.fsf@greed.delorie.com> <22417.12.7.175.2.1185413421.squirrel@webmail.sonic.net>
This is OK.
> 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.
>
> Index: coffgen.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/coffgen.c,v
> retrieving revision 1.59
> diff -p -r1.59 coffgen.c
> *** coffgen.c 12 Jul 2007 07:16:40 -0000 1.59
> --- coffgen.c 26 Jul 2007 01:27:09 -0000
> *************** _bfd_coff_get_external_symbols (bfd *abf
> *** 1444,1452 ****
> symesz = bfd_coff_symesz (abfd);
>
> size = obj_raw_syment_count (abfd) * symesz;
>
> syms = bfd_malloc (size);
> ! if (syms == NULL && size != 0)
> return FALSE;
>
> if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
> --- 1449,1459 ----
> symesz = bfd_coff_symesz (abfd);
>
> size = obj_raw_syment_count (abfd) * symesz;
> + if (size == 0)
> + return TRUE;
>
> syms = bfd_malloc (size);
> ! if (syms == NULL)
> return FALSE;
>
> if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
> ------=_20070725183021_75864--
>
>