Skip to content

Commit 053a08f

Browse files
committed
Merge branch 'jk/maint-http-half-auth-push'
Fixes a regression in maint-1.7.11 (v1.7.11.7), maint (v1.7.12.1) and master (v1.8.0-rc0). * jk/maint-http-half-auth-push: http: fix segfault in handle_curl_result
2 parents 9306b5b + 188923f commit 053a08f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

http.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,9 @@ char *get_remote_object_url(const char *url, const char *hex,
745745
return strbuf_detach(&buf, NULL);
746746
}
747747

748-
int handle_curl_result(struct active_request_slot *slot)
748+
int handle_curl_result(struct active_request_slot *slot,
749+
struct slot_results *results)
749750
{
750-
struct slot_results *results = slot->results;
751-
752751
if (results->curl_result == CURLE_OK) {
753752
credential_approve(&http_auth);
754753
return HTTP_OK;
@@ -822,7 +821,7 @@ static int http_request(const char *url, void *result, int target, int options)
822821

823822
if (start_active_slot(slot)) {
824823
run_active_slot(slot);
825-
ret = handle_curl_result(slot);
824+
ret = handle_curl_result(slot, &results);
826825
} else {
827826
error("Unable to start HTTP request for %s", url);
828827
ret = HTTP_START_FAILED;

http.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ extern int start_active_slot(struct active_request_slot *slot);
7878
extern void run_active_slot(struct active_request_slot *slot);
7979
extern void finish_active_slot(struct active_request_slot *slot);
8080
extern void finish_all_active_slots(void);
81-
extern int handle_curl_result(struct active_request_slot *slot);
81+
extern int handle_curl_result(struct active_request_slot *slot,
82+
struct slot_results *results);
8283

8384
#ifdef USE_CURL_MULTI
8485
extern void fill_active_slots(void);

remote-curl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static int run_slot(struct active_request_slot *slot)
356356
slot->curl_result = curl_easy_perform(slot->curl);
357357
finish_active_slot(slot);
358358

359-
err = handle_curl_result(slot);
359+
err = handle_curl_result(slot, &results);
360360
if (err != HTTP_OK && err != HTTP_REAUTH) {
361361
error("RPC failed; result=%d, HTTP code = %ld",
362362
results.curl_result, results.http_code);

0 commit comments

Comments
 (0)