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

From: Junio C Hamano <junkio@cox.net>
Date: 2005-12-22 07:59:14
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++) {


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Dec 22 07:59:50 2005

This archive was generated by hypermail 2.1.8 : 2005-12-22 07:59:58 EST