This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PR24911, Heap overflow issue in qsort_r, dwarf.c
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 17 Aug 2019 18:08:24 +0930
- Subject: PR24911, Heap overflow issue in qsort_r, dwarf.c
The actual args to this function are "pointers to pointers to
debug_info".
PR 24911
* dwarf.c (comp_addr_base): Dereference args.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index d63383271b..b4738ebb8d 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -6545,8 +6545,8 @@ display_debug_aranges (struct dwarf_section *section,
static int
comp_addr_base (const void * v0, const void * v1)
{
- debug_info * info0 = (debug_info *) v0;
- debug_info * info1 = (debug_info *) v1;
+ debug_info *info0 = *(debug_info **) v0;
+ debug_info *info1 = *(debug_info **) v1;
return info0->addr_base - info1->addr_base;
}
--
Alan Modra
Australia Development Lab, IBM