We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f52abaf commit 92fc5abCopy full SHA for 92fc5ab
1 file changed
sam.c
@@ -588,6 +588,11 @@ int bam_write1(BGZF *fp, const bam1_t *b)
588
const bam1_core_t *c = &b->core;
589
uint32_t x[8], block_len = b->l_data - c->l_extranul + 32, y;
590
int i, ok;
591
+ if (c->l_qname - c->l_extranul > 255) {
592
+ hts_log_error("QNAME \"%s\" is longer than 254 characters", bam_get_qname(b));
593
+ errno = EOVERFLOW;
594
+ return -1;
595
+ }
596
if (c->n_cigar > 0xffff) block_len += 16; // "16" for "CGBI", 4-byte tag length and 8-byte fake CIGAR
597
x[0] = c->tid;
598
x[1] = c->pos;
0 commit comments