mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 23:53:32 +01:00
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]
This commit is contained in:
parent
e6a05c1c54
commit
c9cac69ac6
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user