Skip to content

Fix a divide by zero in cram_xdelta_decode. - #2026

Merged
daviesrob merged 1 commit into
samtools:developfrom
jkbonfield:cram_xdelta-div0
Jun 2, 2026
Merged

Fix a divide by zero in cram_xdelta_decode.#2026
daviesrob merged 1 commit into
samtools:developfrom
jkbonfield:cram_xdelta-div0

Conversation

@jkbonfield

Copy link
Copy Markdown
Contributor

If word_size is zero we do modulo 0 and caused a divide-by-zero crash. Word size is stored in the input data and so we need to validate this, but it's constant so validation is done in the initialisation function only.

We also check for <0 as this has no meaning either.

With thanks to Team Atlanta.

Co-authored-by: Team Atlanta

If word_size is zero we do modulo 0 and caused a divide-by-zero crash.
Word size is stored in the input data and so we need to validate this,
but it's constant so validation is done in the initialisation function
only.

We also check for <0 as this has no meaning either.

With thanks to Team Atlanta.

Co-authored-by: Team Atlanta
Signed-off-by: James Bonfield <jkb@sanger.ac.uk>
@daviesrob
daviesrob merged commit 8985d14 into samtools:develop Jun 2, 2026
17 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.

2 participants