From 22f170abc76f26fc8471e83aa875ec96ca015515 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Wed, 14 Dec 2016 16:47:38 -0600 Subject: [PATCH] Check the name before attempting to call startswith() (#805) --- pwnlib/elf/corefile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwnlib/elf/corefile.py b/pwnlib/elf/corefile.py index 671abbcef..40e8f074b 100644 --- a/pwnlib/elf/corefile.py +++ b/pwnlib/elf/corefile.py @@ -235,7 +235,7 @@ def vsyscall(self): def libc(self): """Return the first mapping in libc""" for m in self.mappings: - if m.name.startswith('libc') and m.name.endswith('.so'): + if m.name and m.name.startswith('libc') and m.name.endswith('.so'): return m @property