From 640e4a31904ea4b6ae479f5f54fdb59a4976646f Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sat, 28 Dec 2019 23:08:50 -0600 Subject: [PATCH] vint: check for bytes after read Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/vint.py | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.2