From f61f1d0c090bb7996bee0d9d4c9c8d77015a644c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 18 Sep 2011 16:50:16 +0000 Subject: Check zero address size. 2011-09-18 H.J. Lu PR binutils/13196 * dwarf.c (display_debug_aranges): Check zero address size. --- binutils/dwarf.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'binutils/dwarf.c') diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 776f775421..1ee0e336c1 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -4215,6 +4215,13 @@ display_debug_aranges (struct dwarf_section *section, address_size = arange.ar_pointer_size + arange.ar_segment_size; + if (address_size == 0) + { + error (_("Invalid address size in %s section!\n"), + section->name); + break; + } + /* The DWARF spec does not require that the address size be a power of two, but we do. This will have to change if we ever encounter an uneven architecture. */ -- cgit v1.2.1