Skip to content

Conversation

@daviesrob
Copy link
Member

This function reads an item count from the input file and uses it to allocate an array of file offsets. It's possible for this to overflow, resulting in an attempt to malloc(0) and, if that returns a valid pointer, an attempt to zero 16 bytes in a zero-length allocation.

Fix by checking that the allocation will not overflow.

Thanks to Harrison Green for reporting this.

This function reads an item count from the input file and uses
it to allocate an array of file offsets.  It's possible for
this to overflow, resulting in an attempt to malloc(0) and,
if that returns a valid pointer, an attempt to zero 16 bytes
in a zero-length allocation.

Fix by checking that the allocation will not overflow.

Thanks to Harrison Green for reporting this.
@whitwham whitwham merged commit 6dd0d7d into samtools:develop Dec 19, 2025
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.

2 participants