samtools / htslib

C library for high-throughput sequencing data formats
Other
783 stars 447 forks source link

Fix duplicated but missing FORMAT bug #1761

Closed daviesrob closed 3 months ago

daviesrob commented 3 months ago

7ce510c added code to drop duplicate FORMAT tags, but missed the case where the duplicated entry was off the end of the per-sample data, so it hit the part that put in MISSING values. This lead to an attempt to call memset() with a negative size. Fixed by adding code to skip the duplicated FORMAT tag.