From 6bedfe19341f4dac9b891fee3796eeba12100264 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 11 Aug 2016 02:15:15 +0100 Subject: [PATCH] Fix input length check error. --- econtext/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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