diff options
author | Brodie Rao <brodie@bitheap.org> | 2011-10-06 02:17:37 +0400 |
---|---|---|
committer | Brodie Rao <brodie@bitheap.org> | 2011-10-13 03:19:46 +0400 |
commit | 6f2856f308918455563413d012e4c4958e57ab40 (patch) | |
tree | ea8d8f0fa54851f2dc7827ca5e7f1b953a42dfee /src/signature.c | |
parent | 15b0bed2ba170526969348170d6f5e0d2ee16d7b (diff) |
signature: don't blow up trying to parse names containing '>'
When trying to find the end of an email, instead of starting at the
beginning of the signature, we start at the end of the name (after the
first '<').
This brings libgit2 more in line with Git's behavior when reading out
existing signatures.
However, note that Git does not allow names like these through the
usual porcelain; instead, it silently strips any '>' characters it
sees.
Diffstat (limited to 'src/signature.c')
-rw-r--r-- | src/signature.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/signature.c b/src/signature.c index ebb56d7ab..388e8d9c9 100644 --- a/src/signature.c +++ b/src/signature.c @@ -279,7 +279,7 @@ int git_signature__parse(git_signature *sig, const char **buffer_out, if ((name_end = strchr(buffer, '<')) == NULL) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse signature. Cannot find '<' in signature"); - if ((email_end = strchr(buffer, '>')) == NULL) + if ((email_end = strchr(name_end, '>')) == NULL) return git__throw(GIT_EOBJCORRUPTED, "Failed to parse signature. Cannot find '>' in signature"); if (email_end < name_end) |