Fix vcfannotate type mismatch, null deref, and stale buffer#2524
Open
sirus20x6 wants to merge 1 commit intosamtools:developfrom
Open
Fix vcfannotate type mismatch, null deref, and stale buffer#2524sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6 wants to merge 1 commit intosamtools:developfrom
Conversation
1. setter_ARinfo_int32 (line 788): Used bcf_get_info_float to read int32 data into an int32 buffer. Changed to bcf_get_info_int32. 2. setter_info_int and setter_info_real: When flushing merged values for Number=A/R tags, `tab` (the annotation line) is NULL, causing a null pointer dereference. Fall back to line->n_allele and line->d.allele when tab is NULL. 3. vcf_setter_format_real: determine_ploidy was called with args->tmpi and args->tmpi2 (int buffers) instead of the float buffers (args->tmpf and args->tmpf2) that actually hold the format data. Cast the float buffers to int* since htslib sentinel values (missing/vector_end) share the same bit patterns between float and int32 representations.
09d7de1 to
42bd119
Compare
pd3
added a commit
that referenced
this pull request
Mar 30, 2026
Member
|
This is not a good fix, it introduces a bug, casting forcibly |
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.
Summary
bcf_get_info_floattobcf_get_info_int32insetter_ARinfo_int32— was reading integer data through the float API, corrupting valuestabinsetter_info_intandsetter_info_realmerge-flush paths — usesline->n_allele/line->d.allelewhentabis NULL for Number=A/R tagsdetermine_ploidyinvcf_setter_format_realto use float buffers instead of stale int buffersTest plan