From ce9b94e93da817c8ed62efcb4d5fce080ed4a91e Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 21 May 2019 12:28:13 +1000 Subject: [PATCH] [common] option: fix crash on failure to parse invalid config file --- VERSION | 2 +- common/src/option.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 3a790571..7699cc25 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-194-g06c229dfd4+1 \ No newline at end of file +a12-195-g7cc0f7cb99+1 \ No newline at end of file diff --git a/common/src/option.c b/common/src/option.c index 199b4f50..cef3ed0f 100644 --- a/common/src/option.c +++ b/common/src/option.c @@ -415,6 +415,13 @@ bool option_load(const char * filename) case '\n': if (name) { + if (!module) + { + DEBUG_ERROR("Syntax error on line %d, module not specified for option", lineno); + result = false; + goto exit; + } + struct Option * o = option_get(module, name); if (!o) DEBUG_WARN("Ignored unknown option %s:%s", module, name);