Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TarHeaderFactory Infinite loop #736

Closed
Ilanlido opened this issue Mar 24, 2023 · 2 comments · Fixed by #835
Closed

TarHeaderFactory Infinite loop #736

Ilanlido opened this issue Mar 24, 2023 · 2 comments · Fixed by #835

Comments

@Ilanlido
Copy link

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
Copy link
Owner

PRs are welcome

@svenclaesson
Copy link

zoneinfo-2010g.zip

This file contains a corrupt tar file that also triggers this infinite loop issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants