mirror of
https://github.com/openssl/openssl.git
synced 2025-03-01 19:28:10 +08:00
Fix memleak in rsa_cms_decrypt
If a call to EVP_PKEY_CTX_set_rsa_mgf1_md() fails then the caller needs to free the label. Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20319)
This commit is contained in:
parent
73ebaac827
commit
d32dd65053
@ -99,8 +99,10 @@ static int rsa_cms_decrypt(CMS_RecipientInfo *ri)
|
||||
if (EVP_PKEY_CTX_set_rsa_mgf1_md(pkctx, mgf1md) <= 0)
|
||||
goto err;
|
||||
if (label != NULL
|
||||
&& EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, label, labellen) <= 0)
|
||||
&& EVP_PKEY_CTX_set0_rsa_oaep_label(pkctx, label, labellen) <= 0) {
|
||||
OPENSSL_free(label);
|
||||
goto err;
|
||||
}
|
||||
/* Carry on */
|
||||
rv = 1;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user