From ebe19ab86c0faf3f02b0c30d8da0d1cadb0fb33a Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 12 Dec 2019 07:34:46 +1000 Subject: [PATCH] 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) --- providers/implementations/macs/poly1305_prov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/implementations/macs/poly1305_prov.c b/providers/implementations/macs/poly1305_prov.c index 950704620f4..1edd2dc0631 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; } -- 2.47.3