gossipd: fix listnodes crash on non existing id

'node_arr' was not instanciated if an id was passed to listnodes and we could not get a node from it
This commit is contained in:
darosior
2019-05-15 22:01:55 +02:00
committed by Christian Decker
parent d054fef0f0
commit d9db9dc1ae

View File

@@ -2220,8 +2220,10 @@ static struct io_plan *getnodes(struct io_conn *conn, struct daemon *daemon,
struct gossip_getnodes_entry,
1);
add_node_entry(node_arr, daemon, n, &node_arr[0]);
} else
} else {
nodes = NULL;
node_arr = NULL;
}
} else {
struct node_map_iter it;
size_t i = 0;