@matheusbsbs / matheus-bagliano / commits / add8e8cee5
Fork 0

http-push: avoid invalid memory accesses

Before objects are sent, the respective ref is locked. However, without this patch, the lock is lifted before the last object for that ref was sent. As a consequence, the lock data was accessed after the lock structure was free()d. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Feb 14, 2008 at 23:25 UTC add8e8cee5054734cb19d918f83bcee649aab326
1 file changed +6 -1
http-push.c
+6 -1
@@ -2398,7 +2398,12 @@ int main(int argc, char **argv)
2398 fill_active_slots();
2399 add_fill_function(NULL, fill_active_slot);
2400 #endif
2401 - finish_all_active_slots();
2401 + do {
2402 + finish_all_active_slots();
2403 +#ifdef USE_CURL_MULTI
2404 + fill_active_slots();
2405 +#endif
2406 + } while (request_queue_head && !aborted);
2407
2408 /* Update the remote branch if all went well */
2409 if (aborted || !update_remote(ref->new_sha1, ref_lock)) {