mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
TarHeaderFactory Infinite loop #566
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ilanlido on GitHub (Mar 24, 2023).
A possible Infinite loop can occur,
Let's look at https://github.com/adamhathcock/sharpcompress/blame/master/src/SharpCompress/Common/Tar/TarHeaderFactory.cs#L51
When the stream that is being used has been closed - for example if the connection was cut, it will keep throw an IOException inside https://github.com/adamhathcock/sharpcompress/blame/master/src/SharpCompress/Common/Tar/TarHeaderFactory.cs#L24
And then and infinite loop of nulls will be here
https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Tar/TarEntry.cs#L62
@adamhathcock commented on GitHub (Mar 27, 2023):
PRs are welcome
@svenclaesson commented on GitHub (May 8, 2023):
zoneinfo-2010g.zip
This file contains a corrupt tar file that also triggers this infinite loop issue.