mirror of
https://github.com/openssl/openssl.git
synced 2025-04-06 20:20:50 +08:00
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)
This commit is contained in:
parent
d7c88f7600
commit
b9d022d78f
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user