mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 11:59:16 +01:00
lightningd: fix crash on bad connect host arg.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
45e9f35988
commit
0069787eb6
1 changed files with 3 additions and 1 deletions
|
@ -773,8 +773,10 @@ static void json_connect(struct command *cmd,
|
|||
port = tal_strdup(cmd, stringify(DEFAULT_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);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Tell it about the address. */
|
||||
msg = towire_gossipctl_peer_addrhint(cmd, &id, &addr);
|
||||
|
|
Loading…
Add table
Reference in a new issue