* merge.c (_bfd_merged_section_offset): Avoid accessing byte before
authorJakub Jelinek <jakub@redhat.com>
Thu, 4 Jul 2002 15:57:24 +0000 (15:57 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 4 Jul 2002 15:57:24 +0000 (15:57 +0000)
section content start.
Reported by Michael Schumacher <mike@hightec-rt.com>.

bfd/ChangeLog
bfd/merge.c

index 3fe196659e975bc7a944e6d4689aae4ff2691cae..5727b7e1bda2981315d2505d8a50c1f96953823d 100644 (file)
@@ -1,3 +1,9 @@
+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>.
+
 2002-07-04  Alan Modra  <amodra@bigpond.net.au>
 
        * section.c (_bfd_strip_section_from_output):  Remove unnecessary
index 866b69ce730a7a8746f8c3724fb7733f1f697cae..df782617edd01f7e9b7e8a9759550486480852d9 100644 (file)
@@ -912,7 +912,7 @@ _bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend)
       if (sec->entsize == 1)
        {
          p = secinfo->contents + offset + addend - 1;
-         while (*p && p >= secinfo->contents)
+         while (p >= secinfo->contents && *p)
            --p;
          ++p;
        }