From: Eric Gillespie Date: Sun, 10 Apr 2016 06:19:19 +0000 (+0000) Subject: check curl_ctx->res_len > 0 not res_body != NULL X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6e50e1df759610bcdd9ffbb26ae405f2289288b9?ds=inline;hp=--cc check curl_ctx->res_len > 0 not res_body != NULL res_body is not a pointer and is never NULL (Thanks clang!) --- 6e50e1df759610bcdd9ffbb26ae405f2289288b9 diff --git a/sbr/oauth.c b/sbr/oauth.c index 0d6d76d4..83639596 100644 --- a/sbr/oauth.c +++ b/sbr/oauth.c @@ -265,7 +265,7 @@ set_err_http(mh_oauth_ctx *ctx, const struct curl_ctx *curl_ctx) /* 5.2. Error Response says error response should use status code 400 and * application/json body. If Content-Type matches, try to parse the body * regardless of the status code. */ - if (curl_ctx->res_body != NULL + if (curl_ctx->res_len > 0 && is_json(curl_ctx->content_type) && get_json_strings(curl_ctx->res_body, curl_ctx->res_len, ctx->log, "error", &error, (void *)NULL)