Fix bfd_read to cope with bad BIMs

DJ Delorie dj@delorie.com
Fri Jan 21 12:18:00 GMT 2000
>   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.

Note that bfd_in_memory support is very weak and many aspects of it
fail.  While it's good to fix these bugs, beware of a false sense of
security.  It barely worked enough for the dll stuff I added back
when, and that was after I added support for things I needed it to do.

>   Is this patch OK to apply ?

Looks OK to me.


More information about the Binutils mailing list