git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Habouzit <madcoder@debian.org>
To: Johannes Sixt <johannes.sixt@telecom.at>
Cc: Junio Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] Fix an infinite loop in sq_quote_buf().
Date: Sun, 04 Nov 2007 22:37:59 +0100	[thread overview]
Message-ID: <20071104213759.GD4207@artemis.corp> (raw)
In-Reply-To: <200711042126.22512.johannes.sixt@telecom.at>

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

On Sun, Nov 04, 2007 at 08:26:22PM +0000, Johannes Sixt wrote:
> sq_quote_buf() treats single-quotes and exclamation marks specially, but
> it incorrectly parsed the input for single-quotes and backslashes.
> 
> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
> ---
>  quote.c          |    2 +-
>  t/t5510-fetch.sh |    7 +++++++
>  2 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/quote.c b/quote.c
> index 482be05..919d092 100644
> --- a/quote.c
> +++ b/quote.c
> @@ -26,7 +26,7 @@ void sq_quote_buf(struct strbuf *dst, const char *src)
>  
>  	strbuf_addch(dst, '\'');
>  	while (*src) {
> -		size_t len = strcspn(src, "'\\");
> +		size_t len = strcspn(src, "'!");
>  		strbuf_add(dst, src, len);
>  		src += len;
>  		while (need_bs_quote(*src)) {

  Ouch, good catch :/ sorry about that.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2007-11-04 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-04 20:26 [PATCH] Fix an infinite loop in sq_quote_buf() Johannes Sixt
2007-11-04 21:37 ` Pierre Habouzit [this message]

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

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

  git send-email \
    --in-reply-to=20071104213759.GD4207@artemis.corp \
    --to=madcoder@debian.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.sixt@telecom.at \
    /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.
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 NNTP newsgroup(s).