Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tighten memory constraints for cram_decode.
SAM aux tags have code [A-Za-z][A-Za-z0-9]. Our content ids also include the type, but we can't have the same code with more than one type. So the maximum number of tags possible is 3224. Each code could be using multiple blocks (eg via byte-array-len), and we have other blocks too for the fixed fields, but a maximum of 10,000 possible blocks in any slice is a generous upper-bound. This avoids memory issues with files where num_content_ids is 100s of millions. We already blocked memory wrap-around and malloc woes, but it's safer to be more restrictive. This also fixes out-of-memory errors in fuzz testing. Credit to OSS-Fuzz Fixes oss-fuzz 61840
- Loading branch information