From: Stanislas P1kachu Lejay Date: Sun, 19 Jun 2016 12:12:41 +0000 (+0200) Subject: Fix case where struct is None X-Git-Tag: v0.24~9^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9983da034319990306e57f89a0630e8a4190d7ff;p=pyelftools.git Fix case where struct is None Signed-off-by: Stanislas P1kachu Lejay --- 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)