]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix segfault in HSPOST command introduce with feature #3523
authorDonncha O'Cearbhaill <donncha@donncha.is>
Fri, 8 May 2015 08:50:13 +0000 (09:50 +0100)
committerDonncha O'Cearbhaill <donncha@donncha.is>
Fri, 8 May 2015 09:16:44 +0000 (10:16 +0100)
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.

src/or/control.c

index 780dea58e09475b41ee56265f7a9c14fa4eec701..d4e106eb9860bdd559a7d803c1510c5c875b2b66 100644 (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;