Merge branch 'rf/maint-mailmap-off-by-one'

* rf/maint-mailmap-off-by-one:
  mailmap: avoid out-of-bounds memory access
This commit is contained in:
Jeff King 2012-11-04 08:00:23 -05:00
commit 0169320374

View File

@ -118,7 +118,7 @@ static char *parse_name_and_email(char *buffer, char **name,
while (isspace(*nstart) && nstart < left)
++nstart;
nend = left-1;
while (isspace(*nend) && nend > nstart)
while (nend > nstart && isspace(*nend))
--nend;
*name = (nstart < nend ? nstart : NULL);