aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorPauli <pauli@openssl.org>2021-06-18 14:43:24 +1000
committerPauli <pauli@openssl.org>2021-06-19 15:47:57 +1000
commitb9d022d78faee0648c3ace7f15ccec08f14feddb (patch)
tree05c75ba2bad0562f35ee0f185fa69c15095c019f /crypto
parentd7c88f760001fae2c608c1d10ae1539fba610288 (diff)
downloadopenssl-b9d022d78faee0648c3ace7f15ccec08f14feddb.zip
openssl-b9d022d78faee0648c3ace7f15ccec08f14feddb.tar.gz
openssl-b9d022d78faee0648c3ace7f15ccec08f14feddb.tar.bz2
params: fix range check when converting double to uint64_t.
Found in #15815 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15819)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/params.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/params.c b/crypto/params.c
index a1db5db..9049041 100644
--- a/crypto/params.c
+++ b/crypto/params.c
@@ -1029,7 +1029,7 @@ int OSSL_PARAM_set_double(OSSL_PARAM *p, double val)
* 15 bits of UINT64_MAX to avoid using imprecise floating
* point values.
*/
- && (double)(UINT64_MAX - 65535) + 65536.0) {
+ && val < (double)(UINT64_MAX - 65535) + 65536.0) {
p->return_size = sizeof(uint64_t);
*(uint64_t *)p->data = (uint64_t)val;
return 1;