libbz2-rs-sys: pass byte counts to custom allocators as (n, 1), like libbzip2 #149
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.50) × (1 − Review Confidence (0.38)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 36 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
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.216
No Reviewer Assigned
no_reviewer_assigned
0.120
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #149"
general
weight: 0.35
sergiodj
libbzip2 requests every block through
BZALLOC(nnn), which callsbzalloc(opaque, nnn, 1). libbz2-rs-sys callsbzalloc(opaque, count, size_of::<T>())instead, so an allocator written against the C library -- one that honours only the second argument, which the C library's calls have always allowed -- returnedcountbytes for a block ofcount size_of::<T>()bytes.This patch passes the byte count (i.e.,
items size) asitemsand size as 1. A count that does not fit the C int fails like a NULL return.Disclaimer: an LLM model was used to verify the patch's correctness. It also generated a reproducer for the issue which I'll be happy to post if necessary.