From: Pauli Date: Wed, 11 Dec 2019 21:34:22 +0000 (+1000) Subject: mac siphash: add missing NULL check on context creation X-Git-Tag: openssl-3.0.0-alpha1~823 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=41a6d557b9e97b71fd178c92981a811face409fb 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) --- 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; }