git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Daniel Stenberg <daniel@haxx.se>
To: Jeff King <peff@peff.net>
Cc: Brandon Casey <bcasey@nvidia.com>,
	git@vger.kernel.org, gitster@pobox.com,
	Brandon Casey <drafnel@gmail.com>
Subject: Re: [PATCH] http.c: don't rewrite the user:passwd string multiple times
Date: Tue, 18 Jun 2013 08:36:59 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1306180825460.24456@tvnag.unkk.fr> (raw)
In-Reply-To: <20130618051902.GA5916@sigill.intra.peff.net>

On Tue, 18 Jun 2013, Jeff King wrote:

TL;DR: I'm just confirming what's said here! =)

> My understanding of curl's pointer requirements are:
>
>  1. Older versions of curl (and I do not recall which version off-hand,
>     but it is not important) stored just the pointer. Calling code was
>     required to manage the string lifetime itself.
>
>  2. Newer versions of curl will strdup the string in curl_easy_setopt.

That's correct. This "new" behavior in (2) was introduced in libcurl 7.17.0 - 
released in September 2007 and should thus be fairly rare by now.

I mention this primarily because I think it should be noted that there will 
probably be very little testing by users with such old libcurl versions. It 
may increase the time between a committed change and people notice brekages 
caused by it. Even Debian old-stable has a much newer version.

> For older versions, if we were to grow the strbuf, we might free() the 
> pointer provided to an earlier call to curl_easy_setopt. But since we are 
> about to call curl_easy_setopt with the new value, I would assume that curl 
> will never actually look at the old one (i.e., when replacing an old 
> pointer, it would not dereference it, but simply overwrite it with the new 
> value).

Another accurate description.

-- 

  / daniel.haxx.se

  reply	other threads:[~2013-06-18  6:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18  2:00 [PATCH] http.c: don't rewrite the user:passwd string multiple times Brandon Casey
2013-06-18  4:15 ` Eric Sunshine
2013-06-18  5:19 ` Jeff King
2013-06-18  6:36   ` Daniel Stenberg [this message]
2013-06-18 15:32     ` Junio C Hamano
2013-06-18 19:29   ` Brandon Casey
2013-06-18 22:13     ` Jeff King
2013-06-19  2:41       ` Brandon Casey
2013-06-19  2:43         ` [PATCH v2] " Brandon Casey
2013-06-19  5:26           ` Jeff King
2013-06-19  7:40       ` [PATCH] " Daniel Stenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1306180825460.24456@tvnag.unkk.fr \
    --to=daniel@haxx.se \
    --cc=bcasey@nvidia.com \
    --cc=drafnel@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).