8000 Fix Unpacker max_buffer_length handling by methane · Pull Request #506 · msgpack/msgpack-python · GitHub
[go: up one dir, main page]

Skip to content

Fix Unpacker max_buffer_length handling #506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading 8000
Diff view
Diff view
Prev Previous commit
fallback raise BufferFull
  • Loading branch information
methane committed May 24, 2022
commit 9f1aceb669bbcf7591da165662722d55c34ce5b1
2 changes: 2 additions & 0 deletions msgpack/fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ def _reserve(self, n, raise_outofdata=True):

# Read from file
remain_bytes = -remain_bytes
if remain_bytes + len(self._buffer) > self._max_buffer_size:
raise BufferFull
while remain_bytes > 0:
to_read_bytes = max(self._read_size, remain_bytes)
read_data = self.file_like.read(to_read_bytes)
Expand Down
0