From cad3c72fce54f81807a459ad18ee901b8d3d4442 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Sun, 29 Oct 2023 04:22:51 +0100 Subject: [PATCH] config: Fix bug where macro definitions were not skipped over properly when parsing --- common/lib/config.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/lib/config.c b/common/lib/config.c index 5821e83d..53d30683 100644 --- a/common/lib/config.c +++ b/common/lib/config.c @@ -253,10 +253,17 @@ int init_config(size_t config_size) { panic(true, "config: Malformed macro usage"); } } - if (config_addr[i] != '=') { + if (config_addr[i++] != '=') { i = orig_i; goto next; } + while (config_addr[i] != '\n' && config_addr[i] != 0) { + i++; + if (i >= config_size) { + bad_config = true; + panic(true, "config: Malformed macro usage"); + } + } continue; }