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

Re: [PATCH] http: fix segfault in handle_curl_result

From
Jeff King <peff@peff.net>
Date
Oct 12, 2012, 07:30 UTC
Message-ID
<20121012073053.GC17026@sigill.intra.peff.net>
In-Reply-To
<20121012062249.GB17026@sigill.intra.peff.net>
On Fri, Oct 12, 2012 at 02:22:49AM -0400, Jeff King wrote:
Show 15 quoted lines
> We should probably not be passing the slot to handle_curl_results at
> all, since it may have already been reused and is not safe to read. The
> only thing we do with it is to set up any new auth information in the
> curl handle.  This doesn't suffer the same problem because a reused slot
> will always have a curl handle. However, it means we may be setting the
> auth information for a random handle. Which is OK, since all handles use
> the same auth information anyway.  But it should also be pointless,
> because since dfa1725 (fix http auth with multiple curl handles) we
> always refresh the curl handle's auth information whenever we get an
> active slot.
> 
> However, I'm leaving that out of this patch.  Commit 8809703 was
> supposed to be a refactor with zero behavior changes, but it regressed.
> This fixes the regression by behaving exactly as we did beforehand. We
> can build the other thing on top.

I took a look at this, and indeed, it breaks existing code. But the broken code is wrong and is easy to fix. So here is a series to do this, on top of the one I am responding to.

These ones shouldn't have any functional impact, but do clean up the code. I'd recommend the regression fix I already posted for maint and 1.8.0, and leave these to cook for post-1.8.0.

  [1/2]: remote-curl: do not call run_slot repeatedly
  [2/2]: http: do not set up curl auth after a 401
-Peff
Previous: Jeff KingNext: Jeff King
Message 3 of 10 in “git fails: segfault at 0 ip 00000000004076d5 sp 00007fff7806ebc0”
  1. Brad HeinOct 12, 2012
  2. http: fix segfault in handle_curl_resultJeff King, Oct 12, 2012
  3. Jeff KingOct 12, 2012
  4. 1/2 remote-curl: do not call run_slot repeatedlyJeff King, Oct 12, 2012
  5. 2/2 http: do not set up curl auth after a 401Jeff King, Oct 12, 2012
  6. Brad HeinOct 12, 2012
  7. Junio C HamanoOct 12, 2012
  8. Erik Faye-LundOct 12, 2012
  9. Erik Faye-LundOct 12, 2012
  10. Jeff KingOct 12, 2012

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.