git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] http-push: avoid invalid memory accesses

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2008, 07:23 UTC
Message-ID
<7vabm1cqkd.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LSU.1.00.0802142325120.30505@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 21 quoted lines
> 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>
> ---
>  http-push.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/http-push.c b/http-push.c
> index b2b410d..7a6c669 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -2398,7 +2398,10 @@ 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 CURL_MULTI
> +			fill_active_slots();
#endif
Show 6 quoted lines
> +		} while (request_queue_head && !aborted);
>  
>  		/* Update the remote branch if all went well */
>  		if (aborted || !update_remote(ref->new_sha1, ref_lock)) {
> -- 
> 1.5.4.1.1353.g0d5dd

I wonder if we should define a no-op function fill_active_slots() for non MULTI case...

Previous: Johannes SchindelinNext: Mike Hommey
Message 3 of 8 in “http-push fixes”
  1. 0/3 http-push fixesJohannes Schindelin, Feb 14, 2008
  2. 1/3 http-push: avoid invalid memory accessesJohannes Schindelin, Feb 14, 2008
  3. Junio C HamanoFeb 16, 2008
  4. Mike HommeyFeb 16, 2008
  5. Johannes SchindelinFeb 16, 2008
  6. 2/3 http-push: do not get confused by submodulesJohannes Schindelin, Feb 14, 2008
  7. 2/3 http-push: do not get confused by submodulesJohannes Schindelin, Feb 14, 2008
  8. 3/3 http-push: avoid a needless gotoJohannes Schindelin, Feb 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.