Abort Irssi on wrong entries in the channels or servers config

This commit is contained in:
Ailin Nemui 2021-01-07 09:12:17 +01:00
commit 16b1d58703
3 changed files with 42 additions and 9 deletions

View file

@ -625,9 +625,18 @@ static void read_servers(void)
/* Read servers */
node = iconfig_node_traverse("servers", FALSE);
if (node != NULL) {
int i = 0;
tmp = config_node_first(node->value);
for (; tmp != NULL; tmp = config_node_next(tmp))
server_setup_read(tmp->data);
for (; tmp != NULL; tmp = config_node_next(tmp), i++) {
node = tmp->data;
if (node->type != NODE_TYPE_BLOCK) {
g_critical("Expected block node at `servers[%d]' was of %s type. "
"Corrupt config?",
i, node->type == NODE_TYPE_LIST ? "list" : "scalar");
} else {
server_setup_read(node);
}
}
}
}