Memory Leak Detected in lib7zip When Parsing Malformed XZ Files#107
Open
vsheludchenkov-nord wants to merge 2 commits intoip7z:mainfrom
Open
Memory Leak Detected in lib7zip When Parsing Malformed XZ Files#107vsheludchenkov-nord wants to merge 2 commits intoip7z:mainfrom
vsheludchenkov-nord wants to merge 2 commits intoip7z:mainfrom
Conversation
Owner
|
I'll fix the code for that memory leak. |
gyurix
reviewed
Apr 16, 2026
gyurix
left a comment
There was a problem hiding this comment.
Core fix looks sensible: free XZ state on early archive-error exits.
Main blocker is freshness: PR is conflicting/stale, and there is no in-tree regression test covering malformed index/trailing-zero paths.
Merge readiness: 7/10. Before merge: rebase cleanly, add a small malformed-XZ regression test, and confirm Xz_Free() is safe on every partial-init path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
While testing malformed files, we identified a memory leak in lib7zip that occurs when the library fails to parse an XZ archive.
Please use the attached test file (test.xz) to reproduce and verify the issue.
test.xz.zip
Best regards,
Vitalii Sheludchenkov