Fix input length check error.

This commit is contained in:
David Wilson 2016-08-11 02:15:15 +01:00
parent eeecf0f984
commit 6bedfe1934
1 changed files with 1 additions and 1 deletions

View File

@ -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