From: Pauli Date: Wed, 11 Dec 2019 21:34:46 +0000 (+1000) Subject: mac poly1305: add missing NULL check in new function. X-Git-Tag: openssl-3.0.0-alpha1~822 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ebe19ab86c0faf3f02b0c30d8da0d1cadb0fb33a;p=oweals%2Fopenssl.git mac poly1305: add missing NULL check in new function. Bug reported by Kihong Heo. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/10613) --- diff --git a/providers/implementations/macs/poly1305_prov.c b/providers/implementations/macs/poly1305_prov.c index 950704620f..1edd2dc063 100644 --- a/providers/implementations/macs/poly1305_prov.c +++ b/providers/implementations/macs/poly1305_prov.c @@ -45,7 +45,8 @@ static void *poly1305_new(void *provctx) { struct poly1305_data_st *ctx = OPENSSL_zalloc(sizeof(*ctx)); - ctx->provctx = provctx; + if (ctx != NULL) + ctx->provctx = provctx; return ctx; }