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