This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PR23147, Heap buffer overflow in pe_print_idata
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 9 May 2018 14:19:49 +0930
- Subject: PR23147, Heap buffer overflow in pe_print_idata
PR 23147
* peXXigen.c (pe_print_idata): Bound check hint_addr.
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 5e0acc4571..b32cc18681 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -1438,7 +1438,7 @@ pe_print_idata (bfd * abfd, void * vfile)
if (hint_addr == 0)
hint_addr = first_thunk;
- if (hint_addr != 0)
+ if (hint_addr != 0 && hint_addr - adj < datasize)
{
bfd_byte *ft_data;
asection *ft_section;
--
Alan Modra
Australia Development Lab, IBM