Re: [PATCH] off-by-one bugs found by valgrind
- From
- H. Peter Anvin <hpa@zytor.com>
- Date
- Dec 21, 2005, 21:17 UTC
- Message-ID
- <43A9C654.2010009@zytor.com>
- In-Reply-To
- <7vr7865fq5.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 14 quoted lines
> 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? >
&& is a sequence point. The code is techically fine, but it's harder than necessary to read.
-hpa