mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
Coverity: fix 1506298: negative returns
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18587)
This commit is contained in:
parent
f80cdee7c1
commit
be54ad88a6
@ -207,6 +207,11 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
|
||||
ASN1_STRING_clear_free(prkey);
|
||||
|
||||
if (dplen <= 0) {
|
||||
ERR_raise(ERR_LIB_DH, DH_R_BN_ERROR);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
|
||||
V_ASN1_SEQUENCE, params, dp, dplen)) {
|
||||
OPENSSL_clear_free(dp, dplen);
|
||||
|
Loading…
Reference in New Issue
Block a user