From 41a6d557b9e97b71fd178c92981a811face409fb Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 12 Dec 2019 07:34:22 +1000 Subject: [PATCH] mac siphash: add missing NULL check on context creation Bug reported by Kihong Heo. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10613) --- providers/implementations/macs/siphash_prov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/implementations/macs/siphash_prov.c b/providers/implementations/macs/siphash_prov.c index d1cb5cf1e7..e82f94ce7b 100644 --- a/providers/implementations/macs/siphash_prov.c +++ b/providers/implementations/macs/siphash_prov.c @@ -51,7 +51,8 @@ static void *siphash_new(void *provctx) { struct siphash_data_st *ctx = OPENSSL_zalloc(sizeof(*ctx)); - ctx->provctx = provctx; + if (ctx != NULL) + ctx->provctx = provctx; return ctx; } -- 2.25.1