check outputs from get_first_listener_addrport_string

Fix for 9650; bugfix for 0.2.3.16-alpha.
This commit is contained in:
Nick Mathewson 2014-03-27 17:11:53 -04:00
parent 0f395a7c06
commit 753a246a14
2 changed files with 12 additions and 4 deletions

4
changes/bug9650 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Avoid potential crashes or bad behavior when launching a
server-side managed proxy with ORPort or ExtORPort temporarily
disabled. Fixes bug 9650; bugfix on 0.2.3.16-alpha.

View File

@ -1243,8 +1243,10 @@ create_managed_proxy_environment(const managed_proxy_t *mp)
{ {
char *orport_tmp = char *orport_tmp =
get_first_listener_addrport_string(CONN_TYPE_OR_LISTENER); get_first_listener_addrport_string(CONN_TYPE_OR_LISTENER);
smartlist_add_asprintf(envs, "TOR_PT_ORPORT=%s", orport_tmp); if (orport_tmp) {
tor_free(orport_tmp); smartlist_add_asprintf(envs, "TOR_PT_ORPORT=%s", orport_tmp);
tor_free(orport_tmp);
}
} }
{ {
@ -1275,8 +1277,10 @@ create_managed_proxy_environment(const managed_proxy_t *mp)
get_first_listener_addrport_string(CONN_TYPE_EXT_OR_LISTENER); get_first_listener_addrport_string(CONN_TYPE_EXT_OR_LISTENER);
char *cookie_file_loc = get_ext_or_auth_cookie_file_name(); char *cookie_file_loc = get_ext_or_auth_cookie_file_name();
smartlist_add_asprintf(envs, "TOR_PT_EXTENDED_SERVER_PORT=%s", if (ext_or_addrport_tmp) {
ext_or_addrport_tmp); smartlist_add_asprintf(envs, "TOR_PT_EXTENDED_SERVER_PORT=%s",
ext_or_addrport_tmp);
}
smartlist_add_asprintf(envs, "TOR_PT_AUTH_COOKIE_FILE=%s", smartlist_add_asprintf(envs, "TOR_PT_AUTH_COOKIE_FILE=%s",
cookie_file_loc); cookie_file_loc);