]> arthur.barton.de Git - bup.git/commitdiff
vint: check for bytes after read
authorRob Browning <rlb@defaultvalue.org>
Sun, 29 Dec 2019 05:08:50 +0000 (23:08 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 19 Jan 2020 17:46:10 +0000 (11:46 -0600)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/vint.py

index cb7225d88e3ddf801c5ce727b3f60560892ae804..143e5b6c75647e46bdbb3ed0bcdc3dbef35ef45b 100644 (file)
@@ -36,6 +36,7 @@ def read_vuint(port):
     c = port.read(1)
     if not c:
         raise EOFError('encountered EOF while reading vuint')
+    assert isinstance(c, bytes)
     if ord(c) == 0:
         return 0
     result = 0
@@ -79,6 +80,7 @@ def read_vint(port):
     c = port.read(1)
     if not c:
         raise EOFError('encountered EOF while reading vint')
+    assert isinstance(c, bytes)
     negative = False
     result = 0
     offset = 0