From 3744787ec01660f903228423f2281ef056f15784 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 8 Jul 2013 08:28:27 +0200 Subject: core: fix crash in evaluation of expression when reading a string in hdata with a NULL value (bug #39419) --- src/core/wee-eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index ccdcf8d44..abd1b03db 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -126,7 +126,8 @@ eval_hdata_get_value (struct t_hdata *hdata, void *pointer, const char *path) value = strdup (str_value); break; case WEECHAT_HDATA_STRING: - value = strdup (hdata_string (hdata, pointer, var_name)); + ptr_value = hdata_string (hdata, pointer, var_name); + value = (ptr_value) ? strdup (ptr_value) : NULL; break; case WEECHAT_HDATA_POINTER: pointer = hdata_pointer (hdata, pointer, var_name); -- cgit v1.2.3