Skip to content

Commit

Permalink
http-push: avoid invalid memory accesses
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Feb 16, 2008
1 parent 0ef617f commit add8e8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -2398,7 +2398,12 @@ int main(int argc, char **argv)
fill_active_slots();
add_fill_function(NULL, fill_active_slot);
#endif
finish_all_active_slots();
do {
finish_all_active_slots();
#ifdef USE_CURL_MULTI
fill_active_slots();
#endif
} while (request_queue_head && !aborted);

/* Update the remote branch if all went well */
if (aborted || !update_remote(ref->new_sha1, ref_lock)) {
Expand Down

0 comments on commit add8e8c

Please sign in to comment.