diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2014-11-21 13:16:42 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2014-11-21 13:16:42 -0500 |
commit | e0482934e6187b2e76c0e44960bcbd3ce3795d0c (patch) | |
tree | d33b02b3a63fe399e24257653ef225588bf96b6f /src/notes.c | |
parent | 6f4461763eb0518112d22c3a096417e7eedf7385 (diff) | |
parent | 24cce2398f893b77f183425fffd957daa3300c5a (diff) | |
download | libgit2-e0482934e6187b2e76c0e44960bcbd3ce3795d0c.tar.gz |
Merge pull request #2725 from libgit2/vmg/attr-null
Do not assume blob contents are NULL terminated
Diffstat (limited to 'src/notes.c')
-rw-r--r-- | src/notes.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/notes.c b/src/notes.c index 046a91614..4b15925fd 100644 --- a/src/notes.c +++ b/src/notes.c @@ -323,11 +323,10 @@ static int note_new( git_signature_dup(¬e->committer, git_commit_committer(commit)) < 0) return -1; - note->message = git__strdup((char *)git_blob_rawcontent(blob)); + note->message = git__strndup(git_blob_rawcontent(blob), git_blob_rawsize(blob)); GITERR_CHECK_ALLOC(note->message); *out = note; - return 0; } |