Skip to content

Commit

Permalink
Fix an undefined addition to a NULL pointer in vcf_format.
Browse files Browse the repository at this point in the history
The pointer was never used, but the NULL+0 still triggers clang's ubsan.
  • Loading branch information
jkbonfield authored and daviesrob committed Jul 18, 2024
1 parent 25d03c6 commit fbe5ff6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -4020,7 +4020,10 @@ int vcf_format(const bcf_hdr_t *h, const bcf1_t *v, kstring_t *s)

kputc_('\t', s); // INFO
if (v->n_info) {
uint8_t *ptr = (uint8_t *)v->shared.s + v->unpack_size[0] + v->unpack_size[1] + v->unpack_size[2];
uint8_t *ptr = v->shared.s
? (uint8_t *)v->shared.s + v->unpack_size[0] +
v->unpack_size[1] + v->unpack_size[2]
: NULL;
int first = 1;
bcf_info_t *info = v->d.info;

Expand Down

0 comments on commit fbe5ff6

Please sign in to comment.