Re: [PATCH] mailmap: avoid out-of-bounds memory access

2012-10-28 Thread Jeff King
On Sun, Oct 28, 2012 at 12:49:55AM +0200, Romain Francoise wrote: AddressSanitizer (http://clang.llvm.org/docs/AddressSanitizer.html) complains of a one-byte buffer underflow in parse_name_and_email() while running the test suite. And indeed, if one of the lines in the mailmap begins with '',

Re: [PATCH] mailmap: avoid out-of-bounds memory access

2012-10-28 Thread Romain Francoise
Jeff King p...@peff.net writes: So you could also check for left == nstart before the loop even begins. I think your fix (to just make the loop more robust to that precondition) is better, though, as the rest of the code does the right thing with such a value of nend. Yep. It looks like

[PATCH] mailmap: avoid out-of-bounds memory access

2012-10-27 Thread Romain Francoise
AddressSanitizer (http://clang.llvm.org/docs/AddressSanitizer.html) complains of a one-byte buffer underflow in parse_name_and_email() while running the test suite. And indeed, if one of the lines in the mailmap begins with '', we dereference the address just before the beginning of the buffer