diff --git a/econtext/core.py b/econtext/core.py index 3ad41482..0901afc1 100644 --- a/econtext/core.py +++ b/econtext/core.py @@ -276,7 +276,7 @@ class Stream(BasicStream): def _ReceiveOne(self): msg_mac = self._input_buf[:20] msg_len = struct.unpack('>L', self._input_buf[20:24])[0] - if len(self._input_buf) < msg_len-24: + if len(self._input_buf)-24 < msg_len: IOLOG.error('Input too short') return False