X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fsck.c;h=6c855f84f01c19678399d85181da1094bd61b371;hb=5c8eeb83dbba11d7e41758b7a8dcb2da6a2025ba;hp=60bd4bbf6a2206e2b1991093ea5d84be7f338f73;hpb=5480861c24b6f5830c2301ae2f50e21ef3cdeaf2;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 != '>')