This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: Fix bfd_read to cope with bad BIMs
- To: nickc at cygnus dot com
- Subject: Re: Fix bfd_read to cope with bad BIMs
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 21 Jan 2000 13:45:58 -0500
- CC: binutils at sourceware dot cygnus dot com
- References: <200001211833.KAA08203@elmo.cygnus.com>
Date: Fri, 21 Jan 2000 10:33:49 -0800
From: Nick Clifton <nickc@cygnus.com>
The patch below fixes a small bug in bfd_read(). If a bfd_in_memory
structure has a "size" field that is less than the value of
"abfd->where" then the code would attempt to memcpy() a negative sized
amount of data, resulting in a segmentation fault.
Is this patch OK to apply ?
Yes, but there is probably another bug. bfd_seek should not let you
set the abfd->where field of a BFD_IN_MEMORY BFD to an invalid value.
Ian