From 894bb1ee0362820cd7f887998259a2e6f41e4621 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 4 Jul 2002 15:57:24 +0000 Subject: [PATCH] * merge.c (_bfd_merged_section_offset): Avoid accessing byte before section content start. Reported by Michael Schumacher . --- bfd/ChangeLog | 6 ++++++ bfd/merge.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 3fe196659e9..5727b7e1bda 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2002-07-04 Jakub Jelinek + + * merge.c (_bfd_merged_section_offset): Avoid accessing byte before + section content start. + Reported by Michael Schumacher . + 2002-07-04 Alan Modra * section.c (_bfd_strip_section_from_output): Remove unnecessary diff --git a/bfd/merge.c b/bfd/merge.c index 866b69ce730..df782617edd 100644 --- a/bfd/merge.c +++ b/bfd/merge.c @@ -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; } -- 2.30.2