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]

Re: Patch: check for invalid string offsets when linking stabs


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


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