Closed SnwMds closed 2 years ago
Thanks for finding the issue here! I've been working on Zippy again lately so I'll be looking at this very soon. I will improve the tests and get this fix merged in.
Hello and thanks again for the PR here. In the end, I did spend a bunch of time looking at this and discovered this is not quite a complete fix so I'm going to close this in favor of what I've got in the works.
I am completely redoing how extractAll works. It's much better now and also fixes this issue among others along the way.
You are correct that we need to read further, however we also need to treat these as "zero terminated oct numbers":
proc parseTarOctInt(s: string): int =
try:
if s[0] == '\0':
0
else:
parseOctInt(s)
except ValueError:
raise currentExceptionAsZippyError()
I'm still working on this new extractAll but I'll post in the issue https://github.com/guzba/zippy/issues/36 with updates.
The size of the header containing information about the permissions of each file can sometimes exceed 6 bytes (e.g. it can be
0000755
instead of000755
), so I increased the bytes range check from100 ..< 106
to100 ..< 107
to match them.I'm not sure what criteria is used for this variation of files, however.