libgit2/libgit2 — pull request #1710 by arrbee (2013-07-06 00:04:03+00:00)
Title: Null byte in hunk header

I'm not sure how it happens, but it seems that sometimes there is a null byte in the hunk header. For me, I have it happen on the following commit/file:

https://git.gnome.org/browse/gitg/diff/libgitg/tests/Makefile.am?id=23bc9feeb7b12a1d6cba2794806fd0297d244a00

@@ -2,7 +2,7 @@ AM_CPPFLAGS = -g -I$(top_srcdir) -I$(top_srcdir)/gitg -I$(top_srcdir)/libgitg $(

Basically, with libgit2 in this hunk header, the last ( is a null byte, then followed by a newline. The header_len reported by the hunk callback reports a length up and including the newline (and thus includes this null byte).