summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-09-10 18:19:13 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-09-12 15:57:24 +1000
commit9951eaf467f8cc43ffad69222b42340c3b24cd52 (patch)
treec2e163031822e0cbec24e22b503b8699cf8ae8cc /crypto/dh
parent0f0b7dfbe5740da9e3fdf4753f8fb56301af13b7 (diff)
Fix coverity issue: CID 1466483 - Improper use of Negative value in dh_ctrl.c
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/12847)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_ctrl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/dh/dh_ctrl.c b/crypto/dh/dh_ctrl.c
index 6fddd271a8..0db5eba505 100644
--- a/crypto/dh/dh_ctrl.c
+++ b/crypto/dh/dh_ctrl.c
@@ -500,6 +500,9 @@ int EVP_PKEY_CTX_set0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char *ukm, int len)
int ret;
OSSL_PARAM params[2], *p = params;
+ if (len <= 0)
+ return -1;
+
ret = dh_param_derive_check(ctx);
if (ret != 1)
return ret;