This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] merge.c fix
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 4 Jul 2002 17:59:23 +0200
- Subject: [PATCH] merge.c fix
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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