Skip to content

Commit 555802f

Browse files
committed
Stricter limit on POS in vcf_parse()
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.
1 parent 9a4b660 commit 555802f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vcf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3703,7 +3703,7 @@ int vcf_parse(kstring_t *s, const bcf_hdr_t *h, bcf1_t *v)
37033703

37043704
overflow = 0;
37053705
char *tmp = p;
3706-
v->pos = hts_str2uint(p, &p, 63, &overflow);
3706+
v->pos = hts_str2uint(p, &p, 62, &overflow);
37073707
if (overflow) {
37083708
hts_log_error("Position value '%s' is too large", tmp);
37093709
goto err;

0 commit comments

Comments
 (0)