diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2013-12-08 12:36:48 -0800 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2013-12-08 12:36:48 -0800 |
commit | 07c5dc84fd486b380d618319b4852591d355bd81 (patch) | |
tree | 59d1302b0cce5465dc25e7f290097dcf34d99b3d /src/commit.c | |
parent | 65e726a8eccf877cc0ccf9ebb335e8d76320658e (diff) | |
parent | be0a1a79588c24b0cf032809c83d0b9cd167e0a9 (diff) | |
download | libgit2-07c5dc84fd486b380d618319b4852591d355bd81.tar.gz |
Merge pull request #1994 from palistov/commit-cleanup
commit: Fix potential segfault
Diffstat (limited to 'src/commit.c')
-rw-r--r-- | src/commit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commit.c b/src/commit.c index bbb76f350..4ddfafb41 100644 --- a/src/commit.c +++ b/src/commit.c @@ -276,10 +276,12 @@ GIT_COMMIT_GETTER(const git_oid *, tree_id, &commit->tree_id); const char *git_commit_message(const git_commit *commit) { - const char *message = commit->raw_message; + const char *message; assert(commit); + message = commit->raw_message; + /* trim leading newlines from raw message */ while (*message && *message == '\n') ++message; |