mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
kdf objects missing a return if malloc fails.
I have searched through all references of ERR_R_MALLOC_FAILURE for any other instances.. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18638)
This commit is contained in:
parent
d842b6eff0
commit
7260709e9e
@ -103,8 +103,10 @@ static void *kdf_tls1_prf_new(void *provctx)
|
|||||||
if (!ossl_prov_is_running())
|
if (!ossl_prov_is_running())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL)
|
if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) {
|
||||||
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
|
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
ctx->provctx = provctx;
|
ctx->provctx = provctx;
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
@ -333,10 +333,12 @@ static void *x942kdf_new(void *provctx)
|
|||||||
KDF_X942 *ctx;
|
KDF_X942 *ctx;
|
||||||
|
|
||||||
if (!ossl_prov_is_running())
|
if (!ossl_prov_is_running())
|
||||||
return 0;
|
return NULL;
|
||||||
|
|
||||||
if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL)
|
if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) {
|
||||||
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
|
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
ctx->provctx = provctx;
|
ctx->provctx = provctx;
|
||||||
ctx->use_keybits = 1;
|
ctx->use_keybits = 1;
|
||||||
return ctx;
|
return ctx;
|
||||||
|
Loading…
Reference in New Issue
Block a user