From c0193bfb7fd4bed31fc68e8f991281aba2973dd0 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Fri, 17 Jun 2011 21:42:11 +0300 Subject: [PATCH] Check that target is string and value is not NULL in json_string_set() --- src/value.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/value.c b/src/value.c index 47ebb2c..d0517d5 100644 --- a/src/value.c +++ b/src/value.c @@ -703,6 +703,9 @@ int json_string_set_nocheck(json_t *json, const char *value) char *dup; json_string_t *string; + if(!json_is_string(json) || !value) + return -1; + dup = jsonp_strdup(value); if(!dup) return -1;