Unverified Commit 94fce582 by Edward Thomson Committed by GitHub

Merge pull request #4894 from pks-t/pks/commit-author-oob

commit: fix out-of-bound reads when parsing truncated author fields
parents 11d33df8 cb23c3ef
......@@ -420,7 +420,7 @@ int git_commit__parse_raw(void *_commit, const char *data, size_t size)
return -1;
/* Some tools create multiple author fields, ignore the extra ones */
while ((size_t)(buffer_end - buffer) >= strlen("author ") && !git__prefixcmp(buffer, "author ")) {
while (!git__prefixncmp(buffer, buffer_end - buffer, "author ")) {
if (git_signature__parse(&dummy_sig, &buffer, buffer_end, "author ", '\n') < 0)
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment