Check that target is string and value is not NULL in json_string_set()

This commit is contained in:
Petri Lehtinen 2011-06-17 21:42:11 +03:00
parent 6e1f4bb560
commit c0193bfb7f

View File

@ -703,6 +703,9 @@ int json_string_set_nocheck(json_t *json, const char *value)
char *dup; char *dup;
json_string_t *string; json_string_t *string;
if(!json_is_string(json) || !value)
return -1;
dup = jsonp_strdup(value); dup = jsonp_strdup(value);
if(!dup) if(!dup)
return -1; return -1;