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

Unified Diff: base/crypto/encryptor_win.cc

Issue 4777001: Implements encryptor_openssl.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux & win Created 10 years, 1 month 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 | « base/crypto/encryptor_unittest.cc ('k') | base/crypto/symmetric_key.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/crypto/encryptor_win.cc
diff --git a/base/crypto/encryptor_win.cc b/base/crypto/encryptor_win.cc
index fe1f5a8e7dca0cdd705d6a4838ad28cc606f1444..4a137b306dbe283f71c98decab64aa29fecdbd7e 100644
--- a/base/crypto/encryptor_win.cc
+++ b/base/crypto/encryptor_win.cc
@@ -93,6 +93,8 @@ bool Encryptor::Encrypt(const std::string& plaintext, std::string* ciphertext) {
bool Encryptor::Decrypt(const std::string& ciphertext, std::string* plaintext) {
DWORD data_len = ciphertext.size();
+ if (data_len == 0)
+ return false;
std::vector<BYTE> tmp(data_len);
memcpy(&tmp[0], ciphertext.data(), data_len);
« no previous file with comments | « base/crypto/encryptor_unittest.cc ('k') | base/crypto/symmetric_key.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698