Skip to content

Commit e117c0f

Browse files
mhdawsonruyadorno
authored andcommitted
crypto: check return code from EVP_DigestUpdate
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 <[email protected]> PR-URL: #41800 Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
1 parent 499171b commit e117c0f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/crypto/crypto_hash.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ bool Hash::HashInit(const EVP_MD* md, Maybe<unsigned int> xof_md_len) {
122122
bool Hash::HashUpdate(const char* data, size_t len) {
123123
if (!mdctx_)
124124
return false;
125-
EVP_DigestUpdate(mdctx_.get(), data, len);
126-
return true;
125+
return EVP_DigestUpdate(mdctx_.get(), data, len) == 1;
127126
}
128127

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

0 commit comments

Comments
 (0)