From: David Levine Date: Mon, 25 Apr 2016 01:42:20 +0000 (-0400) Subject: Return false from parse_json() if jmsn_parse() returns a negative X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/16ceec18fac9f750482e6605b60a0ff9eeb884eb?ds=sidebyside;hp=--cc Return false from parse_json() if jmsn_parse() returns a negative (or zero, as it did before) value. --- 16ceec18fac9f750482e6605b60a0ff9eeb884eb diff --git a/sbr/oauth.c b/sbr/oauth.c index 83639596..57d4bbba 100644 --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -1169,7 +1169,7 @@ parse_json(jsmntok_t **tokens, size_t *tokens_len, of the response body. */ *tokens = mh_xrealloc(*tokens, *tokens_len * sizeof **tokens); } - if (r == 0) { + if (r <= 0) { return FALSE; }