aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/selftest.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@users.noreply.github.com>2020-05-21 14:17:15 +0300
committerrl1987 <rl1987@users.noreply.github.com>2020-05-21 14:17:15 +0300
commita5d28bf88f839c21fbefde8391d777fd9610abd3 (patch)
tree0d136fa3df36dba4cfdd230c0cb1b1d98456a0bd /src/feature/relay/selftest.c
parentded99992b831bfff782a3b3c612297a4634d3d88 (diff)
downloadtor-a5d28bf88f839c21fbefde8391d777fd9610abd3.tar.gz
tor-a5d28bf88f839c21fbefde8391d777fd9610abd3.zip
Check for NULL from tor_dup_ip()
Diffstat (limited to 'src/feature/relay/selftest.c')
-rw-r--r--src/feature/relay/selftest.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index 402ce0e3d3..18fe25b989 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -224,7 +224,11 @@ inform_testing_reachability(void)
const routerinfo_t *me = router_get_my_routerinfo();
if (!me)
return 0;
+
address = tor_dup_ip(me->addr);
+ if (!address)
+ return 0;
+
control_event_server_status(LOG_NOTICE,
"CHECKING_REACHABILITY ORADDRESS=%s:%d",
address, me->or_port);
@@ -255,6 +259,10 @@ router_orport_found_reachable(void)
const or_options_t *options = get_options();
if (!can_reach_or_port && me) {
char *address = tor_dup_ip(me->addr);
+
+ if (!address)
+ return;
+
log_notice(LD_OR,"Self-testing indicates your ORPort is reachable from "
"the outside. Excellent.%s",
options->PublishServerDescriptor_ != NO_DIRINFO
@@ -282,6 +290,10 @@ router_dirport_found_reachable(void)
const or_options_t *options = get_options();
if (!can_reach_dir_port && me) {
char *address = tor_dup_ip(me->addr);
+
+ if (!address)
+ return;
+
log_notice(LD_DIRSERV,"Self-testing indicates your DirPort is reachable "
"from the outside. Excellent.%s",
options->PublishServerDescriptor_ != NO_DIRINFO