Index: crypto/encryptor.cc |
diff --git a/crypto/encryptor.cc b/crypto/encryptor.cc |
index 763dc2c1cb54764ab2428054f9585616f6decdde..69c8f2c7cb1ba330d8df53220ed348a563a4108f 100644 |
--- a/crypto/encryptor.cc |
+++ b/crypto/encryptor.cc |
@@ -94,7 +94,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; |
wtc
2011/12/15 02:03:58
Should we also mark the GenerateCounterMask method
Ryan Sleevi
2011/12/15 02:18:16
Yes. It matches the previous CHECK, but empty plai
wtc
2011/12/15 22:04:14
Thanks for the explanation. This is fine.
|
*mask_len = blocks * kBlockLength; |