diff options
author | Vicent Martà <tanoku@gmail.com> | 2011-10-13 12:16:07 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2011-10-13 12:16:07 -0700 |
commit | 5c3d5fb0182e8c5307dedf9af281fe367a30a16e (patch) | |
tree | 784675cb2aa48226532dee707364310b8a5ec556 /src/commit.c | |
parent | a3e23a7c0a15cbeda434def500acb944a61cc5d4 (diff) | |
parent | 6f2856f308918455563413d012e4c4958e57ab40 (diff) | |
download | libgit2-5c3d5fb0182e8c5307dedf9af281fe367a30a16e.tar.gz |
Merge pull request #454 from brodie/parsing-fixes
Improvements to tag, commit, and signature parsing
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commit.c b/src/commit.c index 0ee3854c4..ced457ecc 100644 --- a/src/commit.c +++ b/src/commit.c @@ -221,10 +221,10 @@ int git_commit__parse_buffer(git_commit *commit, const void *data, size_t len) } /* parse commit message */ - while (buffer < buffer_end && *buffer == '\n') + while (buffer < buffer_end - 1 && *buffer == '\n') buffer++; - if (buffer < buffer_end) { + if (buffer <= buffer_end) { commit->message = git__strndup(buffer, buffer_end - buffer); if (!commit->message) return GIT_ENOMEM; |