In the function
TarHeader.UpdateHeaderFromBytes()
are some converts to int calls.
Some buffer reads are with ".Trim()" some don't.
I have a tar file that crashed the determination of SizeInBytes:
if((buffer[124] & 0x80) == 0x80) // if size in binary
{
long sizeBigEndian = BitConverter.ToInt64(buffer,0x80);
SizeInBytes = IPAddress.NetworkToHostOrder(sizeBigEndian);
}
else
{
SizeInBytes = Convert.ToInt64(Encoding.ASCII.GetString(buffer, 124, 11), 8);
}
In the call of Convert.ToInt64 in the else section. I've added the ".trim"
after the GetString-Method and it works. The result of extrat is similar the
the extracting with 7zip.
Original issue reported on code.google.com by yout...@csp-shop.de on 28 Aug 2014 at 9:57
Original issue reported on code.google.com by
yout...@csp-shop.de
on 28 Aug 2014 at 9:57