Re: [PATCH] off-by-one bugs found by valgrind
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.
> 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++) {