aboutsummaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-04-01 19:05:53 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-04-01 19:05:53 +0000
commit8707bb8715e4fe3e309d7ad3e2d157888a06a6e7 (patch)
tree3d67a0303189eaa66075019456a10a46abbb374f /bfd/xcofflink.c
parent9db037429ba345fce9634d7508673c1cab5409f8 (diff)
downloadgdb-8707bb8715e4fe3e309d7ad3e2d157888a06a6e7.zip
gdb-8707bb8715e4fe3e309d7ad3e2d157888a06a6e7.tar.gz
gdb-8707bb8715e4fe3e309d7ad3e2d157888a06a6e7.tar.bz2
bfd/
* xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 3752f7c..ac0f529 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;