Re: [PATCH] Fix an infinite loop in sq_quote_buf().

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx
OOO                                                http://www.madism.org

Attachment: pgp2gpMZO95PM.pgp
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux