summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-07-08 08:28:27 +0200
committerSebastien Helleu <flashcode@flashtux.org>2013-07-08 08:28:27 +0200
commit3744787ec01660f903228423f2281ef056f15784 (patch)
treedec5b4cd26da6242a7e9a789b06f0cb7736dfa08 /src/core
parentd38d033ce74a88cf4d86a28ed72ba24b63d6806b (diff)
downloadweechat-3744787ec01660f903228423f2281ef056f15784.zip
core: fix crash in evaluation of expression when reading a string in hdata with a NULL value (bug #39419)
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-eval.c3
1 files changed, 2 insertions, 1 deletions
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);