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

do not open corrupted file #9908

Merged
merged 1 commit into from
Apr 11, 2024
Merged

do not open corrupted file #9908

merged 1 commit into from
Apr 11, 2024

Conversation

awskii
Copy link
Member

@awskii awskii commented Apr 10, 2024

Do not open files which are bigger than 32 bytes but "has no" words in it.

@@ -270,6 +275,13 @@ func NewDecompressor(compressedFilePath string) (d *Decompressor, err error) {
}
}
d.wordsStart = pos + 8 + dictSize

if d.Count() == 0 && dictSize == 0 && d.size > compressedMinSize {
d.Close()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we return err from buildCondensedPatternTable also. maybe need add `d.Close() there also. Or close in defer with "err != nil" check.

@AskAlexSharov AskAlexSharov merged commit 642a80a into devel Apr 11, 2024
7 checks passed
@AskAlexSharov AskAlexSharov deleted the fix_decomp_open branch April 11, 2024 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants