From: Danny Al-Gaaf Date: Tue, 14 May 2013 17:54:21 +0000 (+0200) Subject: auth/Crypto.cc: reduce scope of local variable in_buf X-Git-Tag: v0.64~119^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e0f1084580d6a8a2edb14b5dc4c8a93a172b890f;p=ceph.git auth/Crypto.cc: reduce scope of local variable in_buf Signed-off-by: Danny Al-Gaaf --- diff --git a/src/auth/Crypto.cc b/src/auth/Crypto.cc index f2c82c3ab0c1..cf2a75d61265 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 {