Repository navigation
Fix compression-ratio status buffer overflow in CLI tools - #266
Merged
Merged
Conversation
Owner
|
Oh my! It's not Windows mapping Can you remove the "minus one" that you added in the lossy case and rebase this to a single commit? Thanks! |
junkilee80
force-pushed
the
fix/cli-ratio-format-overflow
branch
from
October 15, 2026 04:13
e66ea3f to
fe61289
Compare
Apply David Bryant's revised ratio display in wavpack and wvunpack. Use snprintf with the full buffer size after upstream removes the incorrect _snprintf aliases.
junkilee80
force-pushed
the
fix/cli-ratio-format-overflow
branch
from
October 15, 2026 04:15
fe61289 to
58355de
Compare
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.
Problem
An unusually long compression ratio can overflow the 16-byte
cratiostatus buffer afterwvunpacksuccessfully verifies or decodes a file. The original reproducer reports a stack-buffer-overflow under ASan.Change
Apply David Bryant's revised display policy in the
wvunpackandwavpackrepack status paths: show<-100.00%for ratios at or above 2.0, and usesnprintf()with the full buffer size for percentages and bitrates. This branch is rebased onto upstream commit9bb39ac, which removes the incorrectsnprintfto_snprintfmacros from the CLI sources.Verification
wvunpack -vreproducer reports an ASan stack-buffer-overflow (WRITE of size 17) before the change and exits successfully after it..wv/.wvcpair, normal lossless and hybrid lossy files, andwavpackrepack and encode round trips. Decoded WAV data matched the baseline.The issue was found during CodeQL and ASan analysis. An earlier PailGen draft was reviewed; this PR uses David's revised patch. The final code and results were reviewed manually.