This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: check for invalid string offsets when linking stabs
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 6 Jun 2002 10:15:57 +0930
- Subject: Re: Patch: check for invalid string offsets when linking stabs
- References: <wvnwutdyehg.fsf@talisman.cambridge.redhat.com>
On Wed, Jun 05, 2002 at 03:41:47PM +0100, Richard Sandiford wrote:
> ld can segfault if a stabs entry contains an invalid string offset.
> Is it OK to add a bounds check?
Good idea.
> /* Store the string in the hash table, and record the index. */
> ! symstroff = stroff + bfd_get_32 (abfd, sym + STRDXOFF);
> ! if (symstroff >= stabstrsec->_raw_size)
> ! goto error_return;
bfd_set_error, and print a warning via _bfd_error_handler.
--
Alan Modra
IBM OzLabs - Linux Technology Centre