X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fsck.c;h=6c855f84f01c19678399d85181da1094bd61b371;hb=7a2b128d13d880635e7317a9208cfa42a660f143;hp=60bd4bbf6a2206e2b1991093ea5d84be7f338f73;hpb=5f2e448370e7c436b9ad7e7c495f4c96630f3e3c;p=git.git diff --git a/fsck.c b/fsck.c index 60bd4bbf6..6c855f84f 100644 --- a/fsck.c +++ b/fsck.c @@ -224,13 +224,15 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func) static int fsck_ident(char **ident, struct object *obj, fsck_error error_func) { - if (**ident == '<' || **ident == '\n') - return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email"); - *ident += strcspn(*ident, "<\n"); - if ((*ident)[-1] != ' ') + if (**ident == '<') return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email"); + *ident += strcspn(*ident, "<>\n"); + if (**ident == '>') + return error_func(obj, FSCK_ERROR, "invalid author/committer line - bad name"); if (**ident != '<') return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing email"); + if ((*ident)[-1] != ' ') + return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email"); (*ident)++; *ident += strcspn(*ident, "<>\n"); if (**ident != '>')