5d114eb added extra NULs in memory to ensure that CIGAR data is 4-byte aligned. To avoid breaking bad code that does not use the accessor macros, these extra bytes were included in in-memory l_qname. For QNAMES of length ≥252 characters, this means that l_qname needs to have the value 256, but it is a uint8_t.
There are various ways of fixing this, though it's less straightforward to do so while minimising binary compatibility implications.
This is the cause of pysam-developers/pysam#447.