From 383e52b4983cabcd71055ce8830f4caefe18f6ab Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sun, 25 Feb 2024 23:35:46 -0800 Subject: [PATCH] Fix deprecated use of 0/NULL in featured/util/ClassName.h + 3 Summary: `nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed. This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`. Reviewed By: meyering Differential Revision: D54163048 fbshipit-source-id: b7df83f52abba3ae9f628a5fc8843f073c33a4d6 --- fizz/crypto/signature/Signature.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fizz/crypto/signature/Signature.cpp b/fizz/crypto/signature/Signature.cpp index 9f8babc7bff..c77de429e38 100644 --- a/fizz/crypto/signature/Signature.cpp +++ b/fizz/crypto/signature/Signature.cpp @@ -91,7 +91,8 @@ std::unique_ptr edSign( throw std::runtime_error( to("Could not allocate EVP_MD_CTX", getOpenSSLError())); } - if (EVP_DigestSignInit(mdCtx.get(), NULL, NULL, NULL, pkey.get()) != 1) { + if (EVP_DigestSignInit(mdCtx.get(), nullptr, nullptr, nullptr, pkey.get()) != + 1) { throw std::runtime_error("Could not initialize digest signature"); } auto out = folly::IOBuf::create(EVP_PKEY_size(pkey.get())); @@ -122,7 +123,8 @@ void edVerify( throw std::runtime_error( to("Could not allocate EVP_MD_CTX", getOpenSSLError())); } - if (EVP_DigestVerifyInit(mdCtx.get(), NULL, NULL, NULL, pkey.get()) != 1) { + if (EVP_DigestVerifyInit( + mdCtx.get(), nullptr, nullptr, nullptr, pkey.get()) != 1) { throw std::runtime_error("Could not initialize digest signature"); }