]> granicus.if.org Git - python/commitdiff
Issue #6369: Fix an RLE decompression bug in the binhex module.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 1 Jul 2009 14:53:06 +0000 (14:53 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 1 Jul 2009 14:53:06 +0000 (14:53 +0000)
Lib/binhex.py
Misc/NEWS

index 1c3f3429032667dca3939a237e76121898898372..90e59bce733dc1648f668fa61208ad8175cdaa32 100644 (file)
@@ -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
index 3b8271e57684c870d676467320ffb878b94d577a..f8b6bb5578086035e958628bfb9c1925489cc1c0 100644 (file)
--- 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.