]> diplodocus.org Git - nmh/commitdiff
check curl_ctx->res_len > 0 not res_body != NULL
authorEric Gillespie <epg@pretzelnet.org>
Sun, 10 Apr 2016 06:19:19 +0000 (06:19 +0000)
committerEric Gillespie <epg@pretzelnet.org>
Sun, 10 Apr 2016 06:19:19 +0000 (06:19 +0000)
res_body is not a pointer and is never NULL

(Thanks clang!)

sbr/oauth.c

index 0d6d76d4d1e476c0cda10ee737185e589d461d37..836395966695e626e04bf28f5d2655c1868b59ae 100644 (file)
@@ -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)