mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 10:39:49 +01:00
irc: Checking for param count before accessing
This commit is contained in:
parent
686ff6edef
commit
42a33df42e
@ -225,7 +225,7 @@ static void handle_irc_command(struct ircstate *istate, const struct irccommand
|
||||
struct lightningd_state *dstate = istate->dstate;
|
||||
char **params = tal_strsplit(cmd, cmd->params, " ", STR_NO_EMPTY);
|
||||
|
||||
if (streq(cmd->command, "338")) {
|
||||
if (streq(cmd->command, "338") && tal_count(params) >= 4) {
|
||||
dstate->external_ip = tal_strdup(
|
||||
istate->dstate, params[3]);
|
||||
log_debug(dstate->base_log, "Detected my own IP as %s", dstate->external_ip);
|
||||
|
Loading…
Reference in New Issue
Block a user