[PATCH] merge.c fix
Jakub Jelinek
jakub@redhat.com
Thu Jul 4 09:36:00 GMT 2002
Hi!
I've commited the following patch. _bfd_merged_section_offset could access
a byte before secinfo->contents and segfault if secinfo->contents pointed
at start of an mmap area before figuring out it is at start of section.
2002-07-04 Jakub Jelinek <jakub@redhat.com>
* merge.c (_bfd_merged_section_offset): Avoid accessing byte before
section content start.
Reported by Michael Schumacher <mike@hightec-rt.com>.
--- bfd/merge.c.jj Tue Jun 18 09:59:05 2002
+++ bfd/merge.c Thu Jul 4 18:13:07 2002
@@ -912,7 +912,7 @@ _bfd_merged_section_offset (output_bfd,
if (sec->entsize == 1)
{
p = secinfo->contents + offset + addend - 1;
- while (*p && p >= secinfo->contents)
+ while (p >= secinfo->contents && *p)
--p;
++p;
}
Jakub
More information about the Binutils
mailing list