From: W.C.A. Wijngaards Date: Thu, 3 Mar 2022 15:24:46 +0000 (+0100) Subject: - Fix for #637: fix integer overflow checks in sldns_str2period. X-Git-Tag: release-1.16.0rc1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b202b0874c7571b0ef1ed598264d9acebe3636fd;p=thirdparty%2Funbound.git - Fix for #637: fix integer overflow checks in sldns_str2period. --- diff --git a/doc/Changelog b/doc/Changelog index 2236e5550..3fa86ac3b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 3 March 2022: Wouter - Fix #637: Integer Overflow in sldns_str2period function. + - Fix for #637: fix integer overflow checks in sldns_str2period. 2 March 2022: George - Merge PR #632 from scottrw93: Match cnames in ipset. diff --git a/sldns/parseutil.c b/sldns/parseutil.c index e69c568db..dd1f33484 100644 --- a/sldns/parseutil.c +++ b/sldns/parseutil.c @@ -291,7 +291,7 @@ sldns_str2period(const char *nptr, const char **endptr, int* overflow) case '7': case '8': case '9': - if(i > maxint/10 || i > maxint - (**endptr - '0')) { + if(i > maxint/10 || i*10 > maxint - (**endptr - '0')) { *overflow = 1; return 0; }