]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix coverity CID #1458644 - Negative return passed to function taking size_t in ecdh_...
authorShane Lontis <shane.lontis@oracle.com>
Tue, 11 Aug 2020 06:41:51 +0000 (16:41 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Mon, 24 Aug 2020 01:19:28 +0000 (11:19 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12628)

crypto/ec/ec_ameth.c

index 8840d57188a7336f08d91a21a834cfee1798adc9..67705d6fe40dba34445b9fa9b988074bb6f82376 100644 (file)
@@ -976,7 +976,7 @@ static int ecdh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
 
     plen = CMS_SharedInfo_encode(&der, kekalg, ukm, keylen);
 
-    if (!plen)
+    if (plen <= 0)
         goto err;
 
     if (EVP_PKEY_CTX_set0_ecdh_kdf_ukm(pctx, der, plen) <= 0)