libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.59k stars 383 forks source link

Use returned buffer size of git_buf #1047

Closed jbenc closed 3 years ago

jbenc commented 3 years ago

The returned string may contain a '\0' character. Although not common, it can happen e.g. in the diff output. Instead of truncating the output on the null character, use the returned size from git_buf.

Fixes #1043