Skip to content

Commit 2f3379d

Browse files
daviesrobjkbonfield
authored andcommitted
Fix out-of-bounds read in cram_codec_iter_next()
cram_block_compression_hdr::tag_encoding_map[] has CRAM_MAP_HASH elements, so the iterator should not go beyond that.
1 parent ac0ee54 commit 2f3379d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cram/cram_external.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static cram_codec *cram_codec_iter_next(cram_codec_iter *iter,
291291
iter->curr_map = iter->curr_map->next;
292292
return cc;
293293
}
294-
} while (iter->idx <= CRAM_MAP_HASH);
294+
} while (iter->idx < CRAM_MAP_HASH);
295295

296296
// End of codecs
297297
return NULL;

0 commit comments

Comments
 (0)