Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: crypto/hmac_mac.cc

Issue 7522014: Add WARN_UNUSED_RESULT to crypto/hmac.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix a few more unchecked places from the clang bots Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: crypto/hmac_mac.cc
diff --git a/crypto/hmac_mac.cc b/crypto/hmac_mac.cc
index f9a00cda8adaab7da1a65f24187b5b6f0a70e812..36caa0df8ebf71c50c51f0285469857422294960 100644
--- a/crypto/hmac_mac.cc
+++ b/crypto/hmac_mac.cc
@@ -42,6 +42,12 @@ HMAC::~HMAC() {
bool HMAC::Sign(const base::StringPiece& data,
unsigned char* digest,
int digest_length) const {
+ if (plat_->key_.empty()) {
+ // Init has not been called or has failed.
+ NOTREACHED();
+ return false;
+ }
+
CCHmacAlgorithm algorithm;
int algorithm_digest_length;
switch (hash_alg_) {

Powered by Google App Engine
This is Rietveld 408576698