From 8bc96582f66470854bf722b8a2639cc6c7415b0b Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 7 Mar 2024 10:28:06 +0600 Subject: [PATCH] Added checking for preventing calling system() on empty command string --- source/ubl-settings-system.c | 3 ++- source/ubl-settings-system.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-system.c b/source/ubl-settings-system.c index 47112cf..43707e9 100644 --- a/source/ubl-settings-system.c +++ b/source/ubl-settings-system.c @@ -6,7 +6,8 @@ config main_config; void yon_load_proceed(YON_CONFIG_TYPE type){ yon_config_clean(); - yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); + if (!yon_char_is_empty(config_get_default_command)) + yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); if (type==YON_CONFIG_GLOBAL){ yon_config_load_config(type,config_get_global_command,NULL); } diff --git a/source/ubl-settings-system.h b/source/ubl-settings-system.h index 0004ff5..18e6aaa 100644 --- a/source/ubl-settings-system.h +++ b/source/ubl-settings-system.h @@ -39,7 +39,7 @@ #define config_get_local_command "ubconfig --source system get system HOSTNAME MACHINEID", "ubconfig --source system get locale CONSOLE_FONT LOCALE LANG" #define config_get_global_command "ubconfig --source global get system HOSTNAME MACHINEID", "ubconfig --source global get locale CONSOLE_FONT LOCALE LANG" -#define config_get_default_command "ubconfig --source default get " +#define config_get_default_command "" #define config_get_global_only_parameters "" #define config_get_local_only_parameters ""