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;