- Fix for #637: fix integer overflow checks in sldns_str2period.

This commit is contained in:
W.C.A. Wijngaards 2022-03-03 16:24:46 +01:00
parent debe5c665f
commit b202b0874c
2 changed files with 2 additions and 1 deletions

View file

@ -1,5 +1,6 @@
3 March 2022: Wouter 3 March 2022: Wouter
- Fix #637: Integer Overflow in sldns_str2period function. - Fix #637: Integer Overflow in sldns_str2period function.
- Fix for #637: fix integer overflow checks in sldns_str2period.
2 March 2022: George 2 March 2022: George
- Merge PR #632 from scottrw93: Match cnames in ipset. - Merge PR #632 from scottrw93: Match cnames in ipset.

View file

@ -291,7 +291,7 @@ sldns_str2period(const char *nptr, const char **endptr, int* overflow)
case '7': case '7':
case '8': case '8':
case '9': case '9':
if(i > maxint/10 || i > maxint - (**endptr - '0')) { if(i > maxint/10 || i*10 > maxint - (**endptr - '0')) {
*overflow = 1; *overflow = 1;
return 0; return 0;
} }