Commit be0a1a79 by Paul Holden

commit: Fix potential segfault in git_commit_message

Dereferencing commit pointer before asserting
parent c4fcae5f
......@@ -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;
......
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