aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-10-16 19:34:03 +1030
committerAlan Modra <amodra@gmail.com>2023-10-17 15:17:25 +1030
commit84f24adc5ba65e7850d7a83e8839e305ef23c8d4 (patch)
tree845ebd15b62c1be2d7a9e9ba349e28297e6e4a98 /bfd
parentf46ff02f1812a157c6eb26a4b2edac2c2fbfb271 (diff)
downloadgdb-84f24adc5ba65e7850d7a83e8839e305ef23c8d4.zip
gdb-84f24adc5ba65e7850d7a83e8839e305ef23c8d4.tar.gz
gdb-84f24adc5ba65e7850d7a83e8839e305ef23c8d4.tar.bz2
asan: Invalid free in alpha_ecoff_get_relocated_section_contents
This fixes an ancient bug in commit a3a33af390 (which makes me think this code has never been used). * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Iterate through reloc_vector using a temp.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/coff-alpha.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 1b34a89..59476b5 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -810,13 +810,13 @@ alpha_ecoff_get_relocated_section_contents (bfd *abfd,
}
}
- for (; *reloc_vector != (arelent *) NULL; reloc_vector++)
+ for (arelent **relp = reloc_vector; *relp != NULL; relp++)
{
arelent *rel;
bfd_reloc_status_type r;
char *err;
- rel = *reloc_vector;
+ rel = *relp;
r = bfd_reloc_ok;
switch (rel->howto->type)
{