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