diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-13 08:27:17 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-13 08:27:17 -0500 |
commit | 54d1a2d80537e9f9a90dcca18c9e616f73809f58 (patch) | |
tree | deb55b5b4b337dae12b50d95a2b95b6cb21b7b40 | |
parent | 93b6d4137491cffc906e34dcd3cd4d284ad89e2f (diff) | |
parent | 7f042cbc0a9397c1e5c0f3e9c3bb31ff333d9983 (diff) | |
download | tor-54d1a2d80537e9f9a90dcca18c9e616f73809f58.tar.gz tor-54d1a2d80537e9f9a90dcca18c9e616f73809f58.zip |
Merge branch 'maint-0.2.9' into maint-0.3.3
-rw-r--r-- | changes/bug28413 | 4 | ||||
-rw-r--r-- | src/common/aes.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/changes/bug28413 b/changes/bug28413 new file mode 100644 index 0000000000..4c88bea7e7 --- /dev/null +++ b/changes/bug28413 @@ -0,0 +1,4 @@ + o Minor bugfixes (compilation): + - Initialize a variable in aes_new_cipher(), since some compilers + cannot tell that we always initialize it before use. Fixes bug 28413; + bugfix on 0.2.9.3-alpha. diff --git a/src/common/aes.c b/src/common/aes.c index 5d0841dfa3..4d4a2d773a 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -100,12 +100,12 @@ aes_cnt_cipher_t * aes_new_cipher(const uint8_t *key, const uint8_t *iv, int key_bits) { EVP_CIPHER_CTX *cipher = EVP_CIPHER_CTX_new(); - const EVP_CIPHER *c; + const EVP_CIPHER *c = NULL; switch (key_bits) { case 128: c = EVP_aes_128_ctr(); break; case 192: c = EVP_aes_192_ctr(); break; case 256: c = EVP_aes_256_ctr(); break; - default: tor_assert(0); // LCOV_EXCL_LINE + default: tor_assert_unreached(); // LCOV_EXCL_LINE } EVP_EncryptInit(cipher, c, key, iv); return (aes_cnt_cipher_t *) cipher; @@ -403,4 +403,3 @@ aes_set_iv(aes_cnt_cipher_t *cipher, const uint8_t *iv) } #endif /* defined(USE_EVP_AES_CTR) */ - |