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

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

From
Pierre Habouzit <madcoder@debian.org>
Date
Nov 4, 2007, 21:37 UTC
Message-ID
<20071104213759.GD4207@artemis.corp>
In-Reply-To
<200711042126.22512.johannes.sixt@telecom.at>
On Sun, Nov 04, 2007 at 08:26:22PM +0000, Johannes Sixt wrote:
Show 22 quoted lines
> 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
Previous: Johannes Sixt
Message 2 of 2 in “Fix an infinite loop in sq_quote_buf().”
  1. Fix an infinite loop in sq_quote_buf().Johannes Sixt, Nov 4, 2007
  2. Pierre HabouzitNov 4, 2007

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.