for i in range(21):
try:
offset = nti(buf[pos:pos + 12])
numbytes = nti(buf[pos + 12:pos + 24])
except ValueError:
break
if offset and numbytes:
structs.append((offset, numbytes))
pos += 24
if offset >= 0 and numbytes >= 0:
structs.append((offset, numbytes))
Bug report
Bug description:
cpython/Lib/tarfile.py
Line 1441 in 7040aa5
validation should be added:
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs