OSDN Git Service

* 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 3fe1966..5727b7e 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 866b69c..df78261 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;
        }