From: Rob Browning Date: Sun, 29 Dec 2019 05:08:50 +0000 (-0600) Subject: vint: check for bytes after read X-Git-Tag: 0.31~193 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=640e4a31904ea4b6ae479f5f54fdb59a4976646f;p=bup.git vint: check for bytes after read Signed-off-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/bup/vint.py b/lib/bup/vint.py index cb7225d..143e5b6 100644 --- a/lib/bup/vint.py +++ b/lib/bup/vint.py @@ -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