Browse Source

json_tokener_parse(): avoid possible NULL deref

tags/json-c-0.10-20120530
Frederik Deweerdt 13 years ago
parent
commit
db050901fa
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      json_tokener.c

+ 2
- 0
json_tokener.c View File

@@ -113,6 +113,8 @@ struct json_object* json_tokener_parse(const char *str)
struct json_object* obj;

tok = json_tokener_new();
if (!tok)
return NULL;
obj = json_tokener_parse_ex(tok, str, -1);
if(tok->err != json_tokener_success)
obj = NULL;


Loading…
Cancel
Save