diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-18 04:45:51 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-18 04:45:51 +0000 |
commit | d597b23c421333d4f2f65870694b77510d8fb01e (patch) | |
tree | 711bfbea19a793a0da30eaa1e435a11a9ed88fd2 /src | |
parent | f3f6daf819b73516db0adb4b149a7849188b7038 (diff) | |
download | tor-d597b23c421333d4f2f65870694b77510d8fb01e.tar.gz tor-d597b23c421333d4f2f65870694b77510d8fb01e.zip |
Massage a little code to hopfully please coverity.
svn:r17669
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 8 | ||||
-rw-r--r-- | src/or/test.c | 9 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/or/control.c b/src/or/control.c index 672c3a2683..03f337c61e 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -764,8 +764,8 @@ control_setconf_helper(control_connection_t *conn, uint32_t len, char *body, msg = "553 Unable to set option"; break; case SETOPT_OK: - /* coverity[dead_error_line] - * (It's okay if we can never get to this point.) */ + /* (It's okay if we can never get to this point.) */ + /* coverity[dead_error_line] */ msg = "551 Internal error"; tor_fragile_assert(); break; @@ -1194,8 +1194,8 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len, err: tor_free(password); if (!errstr) { - /* coverity[dead_error_line] - * (It's okay if we can never get to this point.) */ + /* (It's okay if we can never get to this point.) */ + /* coverity[dead_error_line] */ errstr = "Unknown reason."; } connection_printf_to_buf(conn, "515 Authentication failed: %s\r\n", diff --git a/src/or/test.c b/src/or/test.c index af069ce22a..050217c3a7 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -3588,15 +3588,16 @@ test_policy_summary_helper(const char *policy_str, const char *expected_summary) { config_line_t line; - smartlist_t *policy = NULL; + smartlist_t *policy = smartlist_create(); char *summary = NULL; + int r; - policy = NULL; line.key = (char*)"foo"; line.value = (char *)policy_str; line.next = NULL; - test_assert(0 == policies_parse_exit_policy(&line, &policy, 0, NULL)); + r = policies_parse_exit_policy(&line, &policy, 0, NULL); + test_eq(r, 0); summary = policy_summarize(policy); test_assert(summary != NULL); @@ -4184,6 +4185,8 @@ test_crypto_aes_iv(void) crypto_free_cipher_env(cipher); cipher = NULL; test_eq(encrypted_size, 16 + 1); + tor_assert(encrypted_size > 0); /*XXXX021 Obviously this is true. But does + * this make Coverity happy? */ cipher = crypto_create_init_cipher(key1, 0); decrypted_size = crypto_cipher_decrypt_with_iv(cipher, decrypted1, 1, encrypted1, encrypted_size); |