summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-21 10:27:43 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-21 10:27:43 -0400
commitc9cac69ac68d8cdc66d3592f0812988336a1cf8d (patch)
tree992b7132c80e42490f4f0ed0099c7d9c2b3c8d39 /src/or/control.c
parente6a05c1c549dca6e76b900feaee97941c5fb723c (diff)
downloadtor-c9cac69ac68d8cdc66d3592f0812988336a1cf8d.tar.gz
tor-c9cac69ac68d8cdc66d3592f0812988336a1cf8d.zip
Remove a dead check for errmsg in handle_control_authenticate
Coverity doesn't like doing NULL checks on things that can't be NULL; I like checking things where the logic for their not being NULL is nontrivial. Let's compromise, and make it obvious that this field can't be NULL. [Coverity CID 202004]
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 11a853041b..b3a9dd693e 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1039,7 +1039,7 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
{
int used_quoted_string = 0;
const or_options_t *options = get_options();
- const char *errstr = NULL;
+ const char *errstr = "Unknown error";
char *password;
size_t password_len;
const char *cp;
@@ -1199,8 +1199,7 @@ handle_control_authenticate(control_connection_t *conn, uint32_t len,
err:
tor_free(password);
- connection_printf_to_buf(conn, "515 Authentication failed: %s\r\n",
- errstr ? errstr : "Unknown reason.");
+ connection_printf_to_buf(conn, "515 Authentication failed: %s\r\n", errstr);
connection_mark_for_close(TO_CONN(conn));
return 0;
ok: