commit: clear user-provided buffers · nodegit/libgit2@dc851d9 · GitHub
Skip to content

Commit dc851d9

Browse files
committed
commit: clear user-provided buffers
The functions `git_commit_header_field` and `git_commit_extract_signature` both receive buffers used to hand back the results to the user. While these functions called `git_buf_sanitize` on these buffers, this is not the right thing to do, as it will simply initialize or zero-terminate passed buffers. As we want to overwrite contents, we instead have to call `git_buf_clear` to completely reset them.
1 parent cdb2c2a commit dc851d9

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

‎include/git2/commit.h‎

Lines changed: 6 additions & 3 deletions

‎src/commit.c‎

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)