grep: NUL terminate input from a file
commit34f3999206e8ea41b9e4cf48e30ab1149e01d8a5
authorJim Meyering <jim@meyering.net>
Mon, 18 Jan 2010 21:55:07 +0000 (18 22:55 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Jan 2010 01:01:29 +0000 (18 17:01 -0800)
treecad6e7beba3cac964a29f43a28fa38b63b0a4376
parent527b9d704d929a2fff2f9bf1c5e2856725c1416d
grep: NUL terminate input from a file

Internally "git grep" runs regexec(3) that expects its input string
to be NUL terminated.  When searching inside blob data, read_sha1_file()
automatically gives such a buffer, but builtin-grep.c forgot to put
the NUL at the end, even though it allocated enough space for it.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-grep.c