fix: save-sync chunk read crash (#747)

This commit is contained in:
Paweł Lidwin 2026-04-15 14:15:28 +02:00 committed by GitHub
parent 41e3cfab82
commit aeb61d4eea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,12 +92,14 @@ class Chunk:
return self.stored_as & 0x2
@classmethod
def read_buffer(cls, data, secrets):
def read_buffer(cls, data, secrets=None):
_sio = BytesIO(data)
return cls.read(_sio, secrets)
@classmethod
def read(cls, bio, secrets=dict()):
def read(cls, bio, secrets=None):
if secrets is None:
secrets = dict()
head_start = bio.tell()
if struct.unpack('<I', bio.read(4))[0] != cls.header_magic: