Check that target is string and value is not NULL in json_string_set()
This commit is contained in:
parent
6e1f4bb560
commit
c0193bfb7f
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user