Skip to content

Conversation

daviesrob
Copy link
Member

Make normalize_line() report when it skips a line due to a ref mismatch so that normalize_vcf() knows that it has to go on to the next one.

Failing to do this caused a crash when the first input line was skipped because normalize_vcf() attempted to access data via args->rbuf when nothing had been added.

The input file for the bcftools norm -c x did not catch this because the line it skipped was towards the end of the file. An extra record has been added at the front, which does trigger the issue on the original code.

Fixes #2427

Make normalize_line() report when it skips a line due to a ref
mismatch so that normalize_vcf() knows that it has to go on
to the next one.

Failing to do this caused a crash when the first input line
was skipped because normalize_vcf() attempted to access
data via args->rbuf when nothing had been added.

The input file for the `bcftools norm -c x` did not catch this
because the line it skipped was towards the end of the file.
An extra record has been added at the front, which does trigger
the issue on the original code.
@pd3
Copy link
Member

pd3 commented Jul 21, 2025

Thank you

@pd3 pd3 merged commit 2ebe686 into samtools:develop Jul 21, 2025
8 checks passed
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.

bcftools norm unknown segfault
2 participants