Skip to content

Commit

Permalink
Stricter limit on POS in vcf_parse()
Browse files Browse the repository at this point in the history
Limiting POS to 62 bits helps avoid the risk of signed overflow
when it's set to a very extreme value.  The maximum is still
much higher than the length of the longest currently known
reference.
  • Loading branch information
daviesrob committed Jul 30, 2024
1 parent 9a4b660 commit 555802f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3703,7 +3703,7 @@ int vcf_parse(kstring_t *s, const bcf_hdr_t *h, bcf1_t *v)

overflow = 0;
char *tmp = p;
v->pos = hts_str2uint(p, &p, 63, &overflow);
v->pos = hts_str2uint(p, &p, 62, &overflow);
if (overflow) {
hts_log_error("Position value '%s' is too large", tmp);
goto err;
Expand Down

0 comments on commit 555802f

Please sign in to comment.