Fix segfault in HSPOST command introduce with feature #3523

Checking if node->rs->is_hs_dir when the router_status for the node does
not exist results in a segfault. This bug is not in any released Tor.
This commit is contained in:
Donncha O'Cearbhaill 2015-05-08 09:50:13 +01:00
parent e086db7952
commit 4fc21e8dbc

View File

@ -3452,7 +3452,7 @@ handle_control_hspost(control_connection_t *conn,
const char *server = arg + strlen(opt_server);
const node_t *node = node_get_by_hex_id(server);
if (!node) {
if (!node || !node->rs) {
connection_printf_to_buf(conn, "552 Server \"%s\" not found\r\n",
server);
goto done;