Skip to content

Commit e98fa64

Browse files
committed
Merge branch 'jk/maint-http-half-auth-push' into maint
* jk/maint-http-half-auth-push: http: fix segfault in handle_curl_result
2 parents 5a77ff7 + 188923f commit e98fa64

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
@@ -355,7 +355,7 @@ static int run_slot(struct active_request_slot *slot)
355355
slot->curl_result = curl_easy_perform(slot->curl);
356356
finish_active_slot(slot);
357357

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

0 commit comments

Comments
 (0)