Skip to content

Commit

Permalink
utarfile: sanitize file size bytearray
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau committed Jun 17, 2023
1 parent 7128d42 commit 5a083c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion micropython/utarfile/utarfile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def next(self):
# Update the offset once we're sure it's not the run-out.
self.offset += len(buf)
d = TarInfo(str(h.name, "utf-8").rstrip("\0"))
d.size = int(bytes(h.size), 8)
d.size = int(bytes(h.size.replace(b"\x00", b"")), 8)
self.subf = d.subf = FileSection(self.f, d.size, _roundup(d.size, _BLOCKSIZE))
self.offset += _roundup(d.size, _BLOCKSIZE)
return d
Expand Down

0 comments on commit 5a083c9

Please sign in to comment.