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
when looking for whitespace to remove, before checking that we aren't going too far. So reverse the order of the tests to make sure that we don't read outside the buffer. Signed-off-by: Romain Francoise rom...@orebokech.com --- mailmap.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff