From 0277eea799f341272ddac35b3d610dd317ffb784 Mon Sep 17 00:00:00 2001 From: Travis Meisenheimer Date: Wed, 18 Jan 2017 21:36:52 -0600 Subject: [PATCH] crypto: return the retval of HMAC_Update Fixes coverity scan issue 55489. PR-URL: https://github.com/nodejs/node/pull/10891 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Sam Roberts Reviewed-By: Brian White --- src/node_crypto.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index ca5b656817d1ec..7ca97057c0ba12 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3648,8 +3648,8 @@ void Hmac::HmacInit(const FunctionCallbackInfo& args) { bool Hmac::HmacUpdate(const char* data, int len) { if (!initialised_) return false; - HMAC_Update(&ctx_, reinterpret_cast(data), len); - return true; + int r = HMAC_Update(&ctx_, reinterpret_cast(data), len); + return r == 1; }