mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
lightningd: fix crash on bad connect host arg.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
45e9f35988
commit
0069787eb6
@@ -773,8 +773,10 @@ static void json_connect(struct command *cmd,
|
|||||||
port = tal_strdup(cmd, stringify(DEFAULT_PORT));
|
port = tal_strdup(cmd, stringify(DEFAULT_PORT));
|
||||||
}
|
}
|
||||||
addr.port = atoi(port);
|
addr.port = atoi(port);
|
||||||
if (!parse_wireaddr(name, &addr, addr.port) || !addr.port)
|
if (!parse_wireaddr(name, &addr, addr.port) || !addr.port) {
|
||||||
command_fail(cmd, "host %s:%s not valid", name, port);
|
command_fail(cmd, "host %s:%s not valid", name, port);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Tell it about the address. */
|
/* Tell it about the address. */
|
||||||
msg = towire_gossipctl_peer_addrhint(cmd, &id, &addr);
|
msg = towire_gossipctl_peer_addrhint(cmd, &id, &addr);
|
||||||
|
|||||||
Reference in New Issue
Block a user