Skip to content

Commit

Permalink
crypto: check return code from EVP_DigestUpdate
Browse files Browse the repository at this point in the history
Coverity was complaining that we did not check the
return code. We seem to check in the other place it
is called and the method already handles returning
a result.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #41800
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
  • Loading branch information
mhdawson authored and danielleadams committed Mar 3, 2022
1 parent a744b82 commit 5214038
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/crypto/crypto_hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ bool Hash::HashInit(const EVP_MD* md, Maybe<unsigned int> xof_md_len) {
bool Hash::HashUpdate(const char* data, size_t len) {
if (!mdctx_)
return false;
EVP_DigestUpdate(mdctx_.get(), data, len);
return true;
return EVP_DigestUpdate(mdctx_.get(), data, len) == 1;
}

void Hash::HashUpdate(const FunctionCallbackInfo<Value>& args) {
Expand Down

0 comments on commit 5214038

Please sign in to comment.