From e0f1084580d6a8a2edb14b5dc4c8a93a172b890f Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Tue, 14 May 2013 19:54:21 +0200 Subject: [PATCH] auth/Crypto.cc: reduce scope of local variable in_buf Signed-off-by: Danny Al-Gaaf --- src/auth/Crypto.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index f2c82c3ab0c17..cf2a75d612653 100644 --- a/src/auth/Crypto.cc +++ b/src/auth/Crypto.cc @@ -245,7 +245,6 @@ void CryptoAES::encrypt(const bufferptr& secret, const bufferlist& in, bufferlis #ifdef USE_CRYPTOPP { const unsigned char *key = (const unsigned char *)secret.c_str(); - const unsigned char *in_buf; string ciphertext; CryptoPP::AES::Encryption aesEncryption(key, CryptoPP::AES::DEFAULT_KEYLENGTH); @@ -255,8 +254,7 @@ void CryptoAES::encrypt(const bufferptr& secret, const bufferlist& in, bufferlis for (std::list::const_iterator it = in.buffers().begin(); it != in.buffers().end(); ++it) { - in_buf = (const unsigned char *)it->c_str(); - + const unsigned char *in_buf = (const unsigned char *)it->c_str(); stfEncryptor.Put(in_buf, it->length()); } try { -- 2.39.5