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

Unified Diff: crypto/encryptor.cc

Issue 8511050: Unify the error checking of crypto::Encryptor and add WARN_UNUSED_RESULT to prevent misuse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 8 years, 11 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
« no previous file with comments | « crypto/encryptor.h ('k') | crypto/encryptor_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/encryptor.cc
diff --git a/crypto/encryptor.cc b/crypto/encryptor.cc
index 31a7cc830a45d0c4a65de0bfe65262437270793e..984da1fb029f6c3e93f9c05752a9973f2d3a857e 100644
--- a/crypto/encryptor.cc
+++ b/crypto/encryptor.cc
@@ -66,7 +66,8 @@ bool Encryptor::GenerateCounterMask(size_t plaintext_len,
const size_t kBlockLength = counter_->GetLengthInBytes();
size_t blocks = (plaintext_len + kBlockLength - 1) / kBlockLength;
- CHECK(blocks);
+ if (blocks == 0)
+ return false;
*mask_len = blocks * kBlockLength;
« no previous file with comments | « crypto/encryptor.h ('k') | crypto/encryptor_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698