Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix possible heap overflow in cram_encode_aux() on bad RG:Z tags
RG:Z tags without a proper NUL termination could lead to use of invalid data, or a heap overflow when the tag is passed to sam_hrecs_find_rg(), or hts_log_warning() if the former returns NULL. Fix by moving the line that skips to the end of the aux tag and then checking that it was terminated correctly, failing if it was not. Similar checks are also added for MD:Z and generic Z- or H- type tags, to prevent generation of unreadable CRAM files. Credit to OSS-Fuzz Fixes oss-fuzz 66369
- Loading branch information