From 5e4d53d535a3cc9903250b3df0caa829f1c5e4bf Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 26 Oct 2009 21:59:34 -0400 Subject: Remove checks for array existence. (CID 410..415) In C, the code "char x[10]; if (x) {...}" always takes the true branch of the if statement. Coverity notices this now. In some cases, we were testing arrays to make sure that an operation we wanted to do would suceed. Those cases are now always-true. In some cases, we were testing arrays to see if something was _set_. Those caes are now tests for strlen(s), or tests for !tor_mem_is_zero(d,len). --- src/common/crypto.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/common/crypto.c') diff --git a/src/common/crypto.c b/src/common/crypto.c index 5a39a1ab0c..4c880f6b6f 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1260,9 +1260,6 @@ crypto_cipher_set_key(crypto_cipher_env_t *env, const char *key) tor_assert(env); tor_assert(key); - if (!env->key) - return -1; - memcpy(env->key, key, CIPHER_KEY_LEN); return 0; } -- cgit v1.2.3-54-g00ecf