diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-06-02 14:51:13 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-06-02 14:51:13 -0400 |
commit | 34edf17d88a5eaf7bd10aaa557ac5af5c85fa71f (patch) | |
tree | 1b098728504f33a11d0159aed69b4fc684422591 /src/or | |
parent | e8386cce1ce41b667095cd9590567204d2ab0ba0 (diff) | |
parent | 6d8a2ff24f18cc008d3c180a191f5040c7b2e2ba (diff) | |
download | tor-34edf17d88a5eaf7bd10aaa557ac5af5c85fa71f.tar.gz tor-34edf17d88a5eaf7bd10aaa557ac5af5c85fa71f.zip |
Merge remote-tracking branch 'teor/bug16115-minor-fixes'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/control.c | 10 | ||||
-rw-r--r-- | src/or/rendcommon.c | 2 | ||||
-rw-r--r-- | src/or/routerkeys.c | 3 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/or/control.c b/src/or/control.c index 2eaad4e373..7a113f2c1c 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -2193,7 +2193,7 @@ getinfo_helper_onions(control_connection_t *control_conn, { smartlist_t *onion_list = NULL; - if (!strcmp(question, "onions/current")) { + if (control_conn && !strcmp(question, "onions/current")) { onion_list = control_conn->ephemeral_onion_services; } else if (!strcmp(question, "onions/detached")) { onion_list = detached_onion_services; @@ -2201,10 +2201,14 @@ getinfo_helper_onions(control_connection_t *control_conn, return 0; } if (!onion_list || smartlist_len(onion_list) == 0) { - *errmsg = "No onion services of the specified type."; + if (errmsg) { + *errmsg = "No onion services of the specified type."; + } return -1; } - *answer = smartlist_join_strings(onion_list, "\r\n", 0, NULL); + if (answer) { + *answer = smartlist_join_strings(onion_list, "\r\n", 0, NULL); + } return 0; } diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index ec4353c409..0acca58713 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -1417,7 +1417,7 @@ rend_data_dup(const rend_data_t *data) static int compute_desc_id(rend_data_t *rend_data) { - int ret; + int ret = 0; unsigned replica; time_t now = time(NULL); diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index b17d1958f7..e79204cf09 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -152,7 +152,8 @@ ed_key_init_from_file(const char *fname, uint32_t flags, ED25519_PUBKEY_LEN)) { tor_log(severity, LD_OR, "Cert was for wrong key"); bad_cert = 1; - } else if (tor_cert_checksig(cert, &signing_key->pubkey, now) < 0 && + } else if (signing_key && + tor_cert_checksig(cert, &signing_key->pubkey, now) < 0 && (signing_key || cert->cert_expired)) { tor_log(severity, LD_OR, "Can't check certificate"); bad_cert = 1; |