From fb57ad147ea8458e3a9b289bbd7c2ec6c9b232db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 27 Sep 2021 22:02:22 +0200 Subject: [PATCH] core: check that option_name is not NULL in config file functions --- src/core/wee-config-file.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 941df4795..8bc734697 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -835,6 +835,9 @@ config_file_search_option (struct t_config_file *config_file, struct t_config_option *ptr_option; int rc; + if (!option_name) + return NULL; + if (section) { for (ptr_option = section->last_option; ptr_option; @@ -889,6 +892,9 @@ config_file_search_section_option (struct t_config_file *config_file, *section_found = NULL; *option_found = NULL; + if (!option_name) + return; + if (section) { for (ptr_option = section->last_option; ptr_option; @@ -953,6 +959,9 @@ config_file_search_with_string (const char *option_name, if (pos_option_name) *pos_option_name = NULL; + if (!option_name) + return; + ptr_config = NULL; ptr_section = NULL; ptr_option = NULL;