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

Fix out-of-bounds read in cram_codec_iter_next() #1832

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

daviesrob
Copy link
Member

cram_block_compression_hdr::tag_encoding_map[] has CRAM_MAP_HASH elements, so the iterator should not go beyond that.

cram_block_compression_hdr::tag_encoding_map[] has CRAM_MAP_HASH
elements, so the iterator should not go beyond that.
@daviesrob
Copy link
Member Author

Found by running:

UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./samtools cram-size test/cram_size/mpileup.1.cram

on a sanitized samtools.

@jkbonfield jkbonfield merged commit 2f3379d into samtools:develop Sep 5, 2024
9 checks passed
@daviesrob daviesrob deleted the cram_codec_iter_next_fix branch September 6, 2024 09:15
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.

2 participants