1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 10:43:13 +02:00

core: fix crash in /eval when config option has a NULL value

This commit is contained in:
Sebastien Helleu
2014-01-08 09:05:58 +01:00
parent f878997828
commit 9040dfbf52
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -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
+3 -1
View File
@@ -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 ("");
}
}
}