From: Frederik Deweerdt Date: Thu, 19 Jan 2012 01:01:19 +0000 (-0800) Subject: json_tokener_parse(): avoid possible NULL deref X-Git-Tag: json-c-0.10-20120530~37^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11%2Fhead;p=thirdparty%2Fjson-c.git json_tokener_parse(): avoid possible NULL deref --- diff --git a/json_tokener.c b/json_tokener.c index df106b1e..1921de66 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -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;