Skip to content

Commit

Permalink
Avoid divide by 0 exception
Browse files Browse the repository at this point in the history
CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #19310)
  • Loading branch information
kiyolee authored and paulidale committed Oct 2, 2022
1 parent b85d53c commit 3189e12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/internal/safe_math.h
Expand Up @@ -183,7 +183,7 @@
type b, \
int *err) \
{ \
if (a > max / b) \
if (b != 0 && a > max / b) \
*err |= 1; \
return a * b; \
}
Expand Down

0 comments on commit 3189e12

Please sign in to comment.