summaryrefslogtreecommitdiff
path: root/conf/conf.h
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2015-11-09 00:42:02 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-11-09 00:42:02 +0100
commit9b9a7143c43d01f0459d40363d56e9c7690c596f (patch)
tree45571f60f4e3582cd4c0c17c3f1de1c3a2da35dc /conf/conf.h
parent3aed0a6ff7b2b811a535202fd787281d2ac33409 (diff)
Conf: Fixes bug in symbol lookup during reconfiguration
Symbol lookup by cf_find_symbol() not only did the lookup but also added new void symbols allocated from cfg_mem linpool, which gets broken when lookups are done outside of config parsing, which may lead to crashes during reconfiguration. The patch separates lookup-only cf_find_symbol() and config-modifying cf_get_symbol(), while the later is called only during parsing. Also new_config and cfg_mem global variables are NULLed outside of parsing.
Diffstat (limited to 'conf/conf.h')
-rw-r--r--conf/conf.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/conf/conf.h b/conf/conf.h
index 515efbb3..89a2c5b7 100644
--- a/conf/conf.h
+++ b/conf/conf.h
@@ -147,7 +147,9 @@ int cf_lex(void);
void cf_lex_init(int is_cli, struct config *c);
void cf_lex_unwind(void);
-struct symbol *cf_find_symbol(byte *c);
+struct symbol *cf_find_symbol(struct config *cfg, byte *c);
+
+struct symbol *cf_get_symbol(byte *c);
struct symbol *cf_default_name(char *template, int *counter);
struct symbol *cf_define_symbol(struct symbol *symbol, int type, void *def);
void cf_push_scope(struct symbol *);