Skip to content

Commit

Permalink
Fix out-of-bounds read in cram_codec_iter_next()
Browse files Browse the repository at this point in the history
cram_block_compression_hdr::tag_encoding_map[] has CRAM_MAP_HASH
elements, so the iterator should not go beyond that.
  • Loading branch information
daviesrob authored and jkbonfield committed Sep 5, 2024
1 parent ac0ee54 commit 2f3379d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cram/cram_external.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static cram_codec *cram_codec_iter_next(cram_codec_iter *iter,
iter->curr_map = iter->curr_map->next;
return cc;
}
} while (iter->idx <= CRAM_MAP_HASH);
} while (iter->idx < CRAM_MAP_HASH);

// End of codecs
return NULL;
Expand Down

0 comments on commit 2f3379d

Please sign in to comment.