projects
/
pgarchives.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2d4f9b4
)
Forcibly remove \0 at the end of a decoded message
author
Magnus Hagander
<magnus@hagander.net>
Wed, 2 Mar 2016 14:18:46 +0000
(15:18 +0100)
committer
Magnus Hagander
<magnus@hagander.net>
Wed, 2 Mar 2016 14:18:46 +0000
(15:18 +0100)
This happens fairly commonly with some broken MUAs it seems.
loader/lib/parser.py
patch
|
blob
|
blame
|
history
diff --git
a/loader/lib/parser.py
b/loader/lib/parser.py
index 40f0a92de8b5a59353b329b11e6732de13ca1d2c..7e5bdc79dfd437adabb55b6a2c7f1c77d84484f3 100644
(file)
--- a/
loader/lib/parser.py
+++ b/
loader/lib/parser.py
@@
-161,6
+161,11
@@
class ArchivesParser(object):
m = self._re_footer.match(b)
if m:
b = m.group(1)
+
+ # Sometimes we end up with a trailing \0 when decoding long strings, so
+ # replace it if it's there.
+ b = b.rstrip('\0')
+
return b
def _get_body(self):