diff --git a/ChangeLog b/ChangeLog index 074d95658..1f0781709 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] == Version 0.4.3 (under dev) +* core: fix crash in /eval when config option has a NULL value * core: fix crash with hdata_update on shared strings, add hdata type "shared_string" (bug #41104) * core: add support of UTF-8 chars in horizontal/vertical separators (options diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index 468e1497c..739db81e5 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -290,6 +290,8 @@ eval_replace_vars_cb (void *data, const char *text) config_file_search_with_string (text, NULL, NULL, &ptr_option, NULL); if (ptr_option) { + if (!ptr_option->value) + return strdup (""); switch (ptr_option->type) { case CONFIG_OPTION_TYPE_BOOLEAN: @@ -305,7 +307,7 @@ eval_replace_vars_cb (void *data, const char *text) case CONFIG_OPTION_TYPE_COLOR: return strdup (gui_color_get_name (CONFIG_COLOR(ptr_option))); case CONFIG_NUM_OPTION_TYPES: - return NULL; + return strdup (""); } } }