mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 11:52:46 +00:00
Merge pull request #1994 from palistov/commit-cleanup
commit: Fix potential segfault
This commit is contained in:
commit
07c5dc84fd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user