Skip to content

Commit

Permalink
Fix a bytearray index out of range error while reading a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
pufit committed Jan 7, 2024
1 parent b787d3f commit c49ffce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asynch/proto/streams/buffered.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def _read_one(self):
return packet

async def read_varint(self):
if self.position == self.current_buffer_size:
self._reset_buffer()
await self._read_into_buffer()
packets = bytearray()
while True:
if self.position == self.current_buffer_size:
self._reset_buffer()
await self._read_into_buffer()
packet = self._read_one()
packets.append(packet)
if packet < 0x80:
Expand Down

0 comments on commit c49ffce

Please sign in to comment.