zip: Fix crashes on buggy zip output #509
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.19) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.19 · 13 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.158
Real PR Conversation Timeline
1 item
"Review active on #509"
general
weight: 0.35
raveit65
cwendling
Fix crash if the
zipcommand emits a line starting with one of 'd?-' yet having less than 8 fields in it, or if the date field is malformed.Small fixed for not doing nasty things if
unzipdoesn't output what we expect.Testing
Real test should be that it doesn't break anything, as that's what most important (although it's unused for people having one of the 7z, which is used in priority)
Convoluted test is to check what happens with random unexpected output from unzip.
What I did to test unexpected output was add a dummy
unzipto my PATH, and get that to emit output good enough for the code to try and parse it, and bad enough to trigger issues.For example, use this script in your PATH:
<details>
<summary><code>~/.local/bin/unzip</code></summary>
</details>
You also need not to have any 7z, or disable ZIP handling by 7z as it takes precedence:
Normally this should result in a clean Valgrind report (well, for memory errors that is, there's probably a lot of unrelated leaks to be found).