Check json_object_set_new arguments
A segfault was caused by NULL key.
This commit is contained in:
parent
8de850be95
commit
9d648a87cb
@ -148,7 +148,7 @@ int json_object_set_nocheck(json_t *json, const char *key, json_t *value)
|
||||
|
||||
int json_object_set_new(json_t *json, const char *key, json_t *value)
|
||||
{
|
||||
if(!utf8_check_string(key, -1))
|
||||
if(!key || !utf8_check_string(key, -1))
|
||||
{
|
||||
json_decref(value);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user