Skip to content

Fix vcfcnv OOB read with control sample and AA skip mismatch#2529

Open
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/vcfcnv-roh-bugs
Open

Fix vcfcnv OOB read with control sample and AA skip mismatch#2529
sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6:fix/vcfcnv-roh-bugs

Conversation

@sirus20x6
Copy link

Summary

  • Guard parse_lrr_baf for control sample when idx=-1 (no control configured) — was reading BAF/LRR at negative array offset
  • Initialize baf2/lrr2 to safe defaults when control sample parse is skipped
  • Add baf > 4/5. skip (AA genotypes) in the third optimization loop to match the first two loops — without it, loop counter k exceeded tmpf bounds

Test plan

  • Existing test suite passes (1920/1920)
  • Verify bcftools cnv without control sample does not crash

- Guard control_sample parse when idx=-1 to prevent OOB read
- Initialize baf2/lrr2 to safe defaults when parse is skipped
- Add AA genotype skip in third loop to match first two loops
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.

1 participant