Skip to content

Commit

Permalink
Fix deprecated use of 0/NULL in featured/util/ClassName.h + 3
Browse files Browse the repository at this point in the history
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
  • Loading branch information
r-barnes authored and facebook-github-bot committed Feb 26, 2024
1 parent d02e7ac commit 383e52b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fizz/crypto/signature/Signature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ std::unique_ptr<folly::IOBuf> edSign(
throw std::runtime_error(
to<std::string>("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()));
Expand Down Expand Up @@ -122,7 +123,8 @@ void edVerify(
throw std::runtime_error(
to<std::string>("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");
}

Expand Down

0 comments on commit 383e52b

Please sign in to comment.