Skip to content

Commit d071870

Browse files
authored
Merge pull request #190 from refi64/logging-fixes
Fix missing null checks when debug logging request information
2 parents f704623 + 6b6865c commit d071870

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/https_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static int https_fetch_ctx_process_response(https_client_t *client,
453453
res = curl_easy_getinfo(ctx->curl, CURLINFO_EFFECTIVE_URL, &str_resp);
454454
if (res != CURLE_OK) {
455455
ELOG_REQ("CURLINFO_EFFECTIVE_URL: %s", curl_easy_strerror(res));
456-
} else {
456+
} else if (str_resp != NULL) {
457457
DLOG_REQ("CURLINFO_EFFECTIVE_URL: %s", str_resp);
458458
}
459459

@@ -467,7 +467,7 @@ static int https_fetch_ctx_process_response(https_client_t *client,
467467
res = curl_easy_getinfo(ctx->curl, CURLINFO_SCHEME, &str_resp);
468468
if (res != CURLE_OK) {
469469
ELOG_REQ("CURLINFO_SCHEME: %s", curl_easy_strerror(res));
470-
} else if (strcasecmp(str_resp, "https") != 0) {
470+
} else if (str_resp != NULL && strcasecmp(str_resp, "https") != 0) {
471471
DLOG_REQ("CURLINFO_SCHEME: %s", str_resp);
472472
}
473473

0 commit comments

Comments
 (0)