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

Re: [PATCH] off-by-one bugs found by valgrind

From
Junio C Hamano <junkio@cox.net>
Date
Dec 21, 2005, 20:59 UTC
Message-ID
<7vr7865fq5.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1135197348.3046.7.camel@dv>
Pavel Roskin <proski@gnu.org> writes:
> Insufficient memory is allocated in index-pack.c to hold the *.idx name.
> One more byte should be allocated to hold the terminating 0.
Thanks.
> quote_c_style_counted() in quote.c uses a dangerous construct, when a
> variable is incremented once and used twice in the same expression.
Sorry, I do not follow you.  Isn't && a sequence point?
> -	for (sp = name; (ch = *sp++) && (sp - name) <= namelen; ) {
> -
> +	for (sp = name; sp < name + namelen; sp++) {
Previous: Pavel RoskinNext: H. Peter Anvin
Message 2 of 4 in “off-by-one bugs found by valgrind”
  1. off-by-one bugs found by valgrindPavel Roskin, Dec 21, 2005
  2. Junio C HamanoDec 21, 2005
  3. H. Peter AnvinDec 21, 2005
  4. Pavel RoskinDec 21, 2005

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.