mac siphash: add missing NULL check on context creation
[oweals/openssl.git] / providers / implementations / macs / siphash_prov.c
index 190187d690ca46542ecfcfbcf32b9f61749d7ba0..e82f94ce7bd939bbd4d1845c467c9b40a2022944 100644 (file)
@@ -22,7 +22,7 @@
  */
 #include "../../../crypto/siphash/siphash_local.h"
 
-#include "internal/providercommonerr.h"
+#include "prov/providercommonerr.h"
 #include "prov/implementations.h"
 
 /*
@@ -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;
 }