From 555802f1e5a475626ea260563b36fe2dc87f6ce4 Mon Sep 17 00:00:00 2001 From: Rob Davies Date: Tue, 30 Jul 2024 12:49:35 +0100 Subject: [PATCH] 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. --- vcf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcf.c b/vcf.c index daedad34d..7ce306f92 100644 --- a/vcf.c +++ b/vcf.c @@ -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;