From d870214cb9e0b754b66cdcb3df785a6fa823e145 Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Thu, 28 Feb 2019 11:57:25 +0200 Subject: The bitcount will reset only when we move to the next byte. Add a test to verify that parsing two consecutive bitmaps does not fail. --- amqp/serialization.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'amqp/serialization.py') diff --git a/amqp/serialization.py b/amqp/serialization.py index 183ae2e..758a3c0 100644 --- a/amqp/serialization.py +++ b/amqp/serialization.py @@ -172,11 +172,10 @@ def loads(format, buf, offset=0, if not bitcount: bits = ord(buf[offset:offset + 1]) offset += 1 - bitcount = 8 + bitcount = 8 val = (bits & 1) == 1 bits >>= 1 bitcount -= 1 - elif p == 'o': bitcount = bits = 0 val, = unpack_from('>B', buf, offset) -- cgit v1.2.1