From cfe370c6476392095bc3f18013d195b1cccd6184 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Fri, 16 Oct 2009 07:13:25 -0700 Subject: [PATCH 1/2] grep: do not segfault when -f is used "git grep" would segfault if its -f option was used because it would try to use an uninitialized strbuf, so initialize the strbuf. Thanks to Johannes Sixt for the help with the test cases. Signed-off-by: Matt Kraai Signed-off-by: Junio C Hamano --- builtin-grep.c | 2 +- t/t7002-grep.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/builtin-grep.c b/builtin-grep.c index fd450bc16e..e3b940b933 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -599,7 +599,7 @@ static int file_callback(const struct option *opt, const char *arg, int unset) struct grep_opt *grep_opt = opt->value; FILE *patterns; int lno = 0; - struct strbuf sb; + struct strbuf sb = STRBUF_INIT; patterns = fopen(arg, "r"); if (!patterns) diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh index 6ca11d7146..5f91d82297 100755 --- a/t/t7002-grep.sh +++ b/t/t7002-grep.sh @@ -164,6 +164,72 @@ test_expect_success 'grep -e A --and --not -e B' ' test_cmp expected actual ' +test_expect_success 'grep -f, non-existent file' ' + test_must_fail git grep -f patterns +' + +cat >expected <pattern <actual && + test_cmp expected actual +' + +cat >expected <patterns <actual && + test_cmp expected actual +' + +cat >expected <patterns <actual && + test_cmp expected actual +' + cat >expected < Date: Fri, 16 Oct 2009 23:56:55 -0700 Subject: [PATCH 2/2] GIT 1.6.5.1 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.6.5.1.txt | 20 ++++++++++++++++++++ Documentation/git.txt | 1 + GIT-VERSION-GEN | 2 +- RelNotes | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 Documentation/RelNotes-1.6.5.1.txt diff --git a/Documentation/RelNotes-1.6.5.1.txt b/Documentation/RelNotes-1.6.5.1.txt new file mode 100644 index 0000000000..309ba181b2 --- /dev/null +++ b/Documentation/RelNotes-1.6.5.1.txt @@ -0,0 +1,20 @@ +GIT v1.6.5.1 Release Notes +========================== + +Fixes since v1.6.5 +------------------ + + * An corrupt pack could make codepath to read objects into an + infinite loop. + + * Download throughput display was always shown in KiB/s but on fast links + it is more appropriate to show it in MiB/s. + + * "git grep -f filename" used uninitialized variable and segfaulted. + + * "git clone -b branch" gave a wrong commit object name to post-checkout + hook. + + * "git pull" over http did not work on msys. + +Other minor documentation updates are included. diff --git a/Documentation/git.txt b/Documentation/git.txt index d97aaf5bf8..d11c5c1651 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -46,6 +46,7 @@ Documentation for older releases are available here: * link:v1.6.5/git.html[documentation for release 1.6.5] * release notes for + link:RelNotes-1.6.5.1.txt[1.6.5.1], link:RelNotes-1.6.5.txt[1.6.5]. * link:v1.6.4.4/git.html[documentation for release 1.6.4.4] diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 08e6073f33..d11e43cf31 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.6.5 +DEF_VER=v1.6.5.1 LF=' ' diff --git a/RelNotes b/RelNotes index b62449d2e2..dda06d1d8f 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.6.5.txt \ No newline at end of file +Documentation/RelNotes-1.6.5.1.txt \ No newline at end of file