Ensure leftover bytes are a copy

This commit is contained in:
Kovid Goyal 2024-01-02 14:30:43 +05:30
parent a33b747de5
commit 89debca4af
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -283,7 +283,7 @@ class WriteRequest:
extra = len(data) % 4
if extra > 0:
mv = memoryview(data)
self.current_leftover_bytes = mv[-extra:]
self.current_leftover_bytes = memoryview(bytes(mv[-extra:]))
mv = mv[:-extra]
if len(mv) > 0:
self.write_base64_data(mv)