From 9983da034319990306e57f89a0630e8a4190d7ff Mon Sep 17 00:00:00 2001 From: Stanislas P1kachu Lejay Date: Sun, 19 Jun 2016 14:12:41 +0200 Subject: [PATCH] Fix case where struct is None Signed-off-by: Stanislas P1kachu Lejay --- elftools/dwarf/dwarfinfo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/elftools/dwarf/dwarfinfo.py b/elftools/dwarf/dwarfinfo.py index 1995fc8..5a5c41a 100644 --- a/elftools/dwarf/dwarfinfo.py +++ b/elftools/dwarf/dwarfinfo.py @@ -191,6 +191,9 @@ class DWARFInfo(object): def _parse_CUs_iter(self): """ Parse CU entries from debug_info. Yield CUs in order of appearance. """ + if self.debug_info_sec is None: + return + offset = 0 while offset < self.debug_info_sec.size: cu = self._parse_CU_at_offset(offset) -- 2.30.2