projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1da8dd
)
asan: buffer overflow in sh_reloc
author
Alan Modra
<amodra@gmail.com>
Wed, 14 Dec 2022 04:16:07 +0000
(14:46 +1030)
committer
Alan Modra
<amodra@gmail.com>
Wed, 14 Dec 2022 11:15:04 +0000
(21:45 +1030)
* coff-sh.c (sh_reloc): Use bfd_reloc_offset_in_range.
bfd/coff-sh.c
patch
|
blob
|
history
diff --git
a/bfd/coff-sh.c
b/bfd/coff-sh.c
index c5b69a8592fda01773721cf290e20571f1580f25..d030c47553973638b8a9325014011bc1eb76018c 100644
(file)
--- a/
bfd/coff-sh.c
+++ b/
bfd/coff-sh.c
@@
-597,7
+597,8
@@
sh_reloc (bfd * abfd,
&& bfd_is_und_section (symbol_in->section))
return bfd_reloc_undefined;
- if (addr > input_section->size)
+ if (!bfd_reloc_offset_in_range (reloc_entry->howto, abfd, input_section,
+ addr))
return bfd_reloc_outofrange;
sym_value = get_symbol_value (symbol_in);