From: Kelvin Lee Date: Fri, 30 Sep 2022 08:26:37 +0000 (+1000) Subject: Avoid divide by 0 exception X-Git-Tag: openssl-3.2.0-alpha1~1982 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3189e12733e676fbbc30b1b2d98952a6a9f78073;p=thirdparty%2Fopenssl.git Avoid divide by 0 exception CLA: trivial Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/19310) --- diff --git a/include/internal/safe_math.h b/include/internal/safe_math.h index 9a20957eb65..be37e6ab882 100644 --- a/include/internal/safe_math.h +++ b/include/internal/safe_math.h @@ -183,7 +183,7 @@ type b, \ int *err) \ { \ - if (a > max / b) \ + if (b != 0 && a > max / b) \ *err |= 1; \ return a * b; \ }