summaryrefslogtreecommitdiff
path: root/src/leap/mail/walk.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-01-09 21:13:05 -0300
committerTomás Touceda <chiiph@leap.se>2014-01-09 21:13:05 -0300
commit761ab0014553d6e742fb5cd19cdbea707f59d816 (patch)
tree7eb6eb77d74f9d14519ab32f2b91a9e9971a4c27 /src/leap/mail/walk.py
parentf4ab2153796f4ba227cc3b7cc98fd3fe83901806 (diff)
parentddb50ed05ae7141c2f9c2aece9e24681e0d5d696 (diff)
Merge remote-tracking branch 'refs/remotes/kali/bug/nonecheck-for-innerheaders' into develop
Diffstat (limited to 'src/leap/mail/walk.py')
-rw-r--r--src/leap/mail/walk.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/leap/mail/walk.py b/src/leap/mail/walk.py
index dc13345..1871752 100644
--- a/src/leap/mail/walk.py
+++ b/src/leap/mail/walk.py
@@ -111,8 +111,8 @@ def walk_msg_tree(parts, body_phash=None):
# parts vector
pv = list(get_parts_vector(parts))
- if len(parts) == 2:
- inner_headers = parts[1].get("headers", None)
+ inner_headers = parts[1].get("headers", None) if (
+ len(parts) == 2) else None
if DEBUG:
print "parts vector: ", pv
@@ -155,7 +155,8 @@ def walk_msg_tree(parts, body_phash=None):
pdoc["part_map"][1]["multi"] = False
if not pdoc["part_map"][1].get("phash", None):
pdoc["part_map"][1]["phash"] = body_phash
- pdoc["part_map"][1]["headers"] = inner_headers
+ if inner_headers:
+ pdoc["part_map"][1]["headers"] = inner_headers
else:
pdoc = outer
pdoc["body"] = body_phash