From 8707bb8715e4fe3e309d7ad3e2d157888a06a6e7 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 1 Apr 2009 19:05:53 +0000 Subject: [PATCH] bfd/ * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun. --- bfd/ChangeLog | 4 ++++ bfd/xcofflink.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e0ed3a66a3e..cbfad171d3a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2009-04-01 Richard Sandiford + + * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun. + 2009-04-01 Christophe Lyon * elf32-arm.c (group_sections): Rewrite loops for better diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 3752f7c8678..ac0f529f640 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -4268,14 +4268,13 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *finfo, bfd_coff_swap_lineno_in (input_bfd, linp, &lin); lin.l_addr.l_symndx = *indexp; bfd_coff_swap_lineno_out (output_bfd, &lin, linp); - linp += linesz; /* Copy the other entries, adjusting their addresses. */ linpend = linp + *lineno_counts * linesz; offset = (o->output_section->vma + o->output_offset - o->vma); - for (; linp < linpend; linp += linesz) + for (linp += linesz; linp < linpend; linp += linesz) { bfd_coff_swap_lineno_in (input_bfd, linp, &lin); lin.l_addr.l_paddr += offset; -- 2.30.2