projects
/
pyelftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09e39e4
)
Fix parsing string table (#134)
author
gcmoreira
<gmoreira@gmail.com>
Thu, 2 Feb 2017 13:47:30 +0000
(
00:47
+1100)
committer
Eli Bendersky
<eliben@users.noreply.github.com>
Thu, 2 Feb 2017 13:47:30 +0000
(
05:47
-0800)
If for any reason parse_cstring_from_stream() cannot get a string in the given offset, it'll return None causing the following line raises an exception when it tries to get the decoded ascii string from the None object.
elftools/elf/sections.py
patch
|
blob
|
history
diff --git
a/elftools/elf/sections.py
b/elftools/elf/sections.py
index 99550ac365578e67d5b4bde0493a02dde511ee7b..1bc17157c3f58dc583f56d451d65fae011a0b898 100644
(file)
--- a/
elftools/elf/sections.py
+++ b/
elftools/elf/sections.py
@@
-71,7
+71,7
@@
class StringTableSection(Section):
"""
table_offset = self['sh_offset']
s = parse_cstring_from_stream(self.stream, table_offset + offset)
- return s.decode('ascii')
+ return s.decode('ascii')
if s else ''
class SymbolTableSection(Section):