Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent segfault on empty tbi index #1845

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

pd3
Copy link
Member

@pd3 pd3 commented Oct 3, 2024

When an empty VCF file with a header but no data lines is indexed, tbx_seqnames() called via bcf_sr_add_reader() returns an empty list. Consequently, when bcf_sr_regions_next() is called and no in-memory regions are available, it attempts to read from a file which is not initialized.

This fixes samtools/bcftools#2286

When an empty VCF file with a header but no data lines is indexed,
tbx_seqnames() called via bcf_sr_add_reader() returns an empty list.
Consequently, when bcf_sr_regions_next() is called and no in-memory
regions are available, it attempts to read from a file which is
not initialized.

This fixes samtools/bcftools#2286
@daviesrob daviesrob merged commit e0d1956 into samtools:develop Oct 8, 2024
9 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 concat segfault if VCF files contain only headers
2 participants