Patch: check for invalid string offsets when linking stabs
Alan Modra
amodra@bigpond.net.au
Wed Jun 5 17:46:00 GMT 2002
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
More information about the Binutils
mailing list