]> git.meshlink.io Git - meshlink/commitdiff
Fix a potential segfault.
authorGuus Sliepen <guus@meshlink.io>
Tue, 20 Nov 2018 15:01:12 +0000 (16:01 +0100)
committerGuus Sliepen <guus@meshlink.io>
Tue, 20 Nov 2018 15:01:12 +0000 (16:01 +0100)
This was found by Lakshminarayana Gurram.

src/protocol_auth.c

index e56aa88132d3977031fc08e4a4bf57de1add1aa8..487f34c96ebef3f640ea2339540dc7607100fe62 100644 (file)
@@ -402,7 +402,7 @@ bool id_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
 
                node_t *n = lookup_node(mesh, c->name);
 
-               if(n && !n->status.waitingforkey) {
+               if(n && n->status.reachable && !n->status.waitingforkey) {
                        logger(mesh, MESHLINK_INFO, "Requesting key from peer %s", c->name);
                        send_req_key(mesh, n);
                }