From: Antoine Pitrou Date: Wed, 1 Jul 2009 14:53:06 +0000 (+0000) Subject: Issue #6369: Fix an RLE decompression bug in the binhex module. X-Git-Tag: v3.2a1~2909 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54923951ad1bdd33028f94ed337e1a0473366605;p=python Issue #6369: Fix an RLE decompression bug in the binhex module. --- diff --git a/Lib/binhex.py b/Lib/binhex.py index 1c3f342903..90e59bce73 100644 --- a/Lib/binhex.py +++ b/Lib/binhex.py @@ -324,11 +324,11 @@ class _Rledecoderengine: mark = len(self.pre_buffer) if self.pre_buffer[-3:] == RUNCHAR + b'\0' + RUNCHAR: mark = mark - 3 - elif self.pre_buffer[-1] == RUNCHAR: + elif self.pre_buffer[-1:] == RUNCHAR: mark = mark - 2 elif self.pre_buffer[-2:] == RUNCHAR + b'\0': mark = mark - 2 - elif self.pre_buffer[-2] == RUNCHAR: + elif self.pre_buffer[-2:-1] == RUNCHAR: pass # Decode all else: mark = mark - 1 diff --git a/Misc/NEWS b/Misc/NEWS index 3b8271e576..f8b6bb5578 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -27,6 +27,8 @@ Core and Builtins Library ------- +- Issue #6369: Fix an RLE decompression bug in the binhex module. + - Issue #6344: Fixed a crash of mmap.read() when passed a negative argument. - The deprecated function string.maketrans has been removed.