diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-18 17:03:34 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-18 17:03:34 -0800 |
commit | 7d0dafe3945408aeef9c2e5256ac926976170e54 (patch) | |
tree | 01187d82cec0dfc4d72bbcf42a35abb4a27ca6ed /builtin-grep.c | |
parent | Fix uninitialized variable in get_refs_via_rsync(). (diff) | |
parent | grep: NUL terminate input from a file (diff) | |
download | tgif-7d0dafe3945408aeef9c2e5256ac926976170e54.tar.xz |
Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint
* jm/maint-1.6.5-grep-NUL-terminate:
grep: NUL terminate input from a file
Diffstat (limited to 'builtin-grep.c')
-rw-r--r-- | builtin-grep.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-grep.c b/builtin-grep.c index af6c6fe8a7..c7d74fbb7f 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -205,6 +205,7 @@ static int grep_file(struct grep_opt *opt, const char *filename) return 0; } close(i); + data[sz] = 0; if (opt->relative && opt->prefix_length) filename = quote_path_relative(filename, -1, &buf, opt->prefix); i = grep_buffer(opt, filename, data, sz); |