diff options
author | Alexander Færøy <ahf@0x90.dk> | 2015-01-05 01:05:14 +0100 |
---|---|---|
committer | Alexander Færøy <ahf@0x90.dk> | 2015-01-05 01:05:14 +0100 |
commit | b2fe8611563c6478fd856f825eb5c5cc3e3f100b (patch) | |
tree | b8f75462d4d0bfcb861db5eaf20070e1e03b0c0f /src | |
parent | 9abdeb8611977e0ab56ce3e30ee9561a7e8cb204 (diff) | |
parent | db62ddfd557799981d779914a5e82473a6b22df8 (diff) | |
download | irssi-b2fe8611563c6478fd856f825eb5c5cc3e3f100b.zip |
Merge pull request #191 from dgl/config-error
Die if the wrong type of node is found when traversing config
Diffstat (limited to 'src')
-rw-r--r-- | src/lib-config/get.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib-config/get.c b/src/lib-config/get.c index 2f1e90e1..af02b048 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -109,6 +109,12 @@ CONFIG_NODE *config_node_traverse(CONFIG_REC *rec, const char *section, int crea } g_strfreev(list); + if (!is_node_list(node)) { + /* Will die. Better to not corrupt the config further in this case. */ + g_error("Attempt to use non-list node as list. Corrupt config?"); + return NULL; + } + /* save to cache */ str = g_strdup(section); g_hash_table_insert(rec->cache, str, node); |