grep: fix segfault when "git grep '('" is given

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Linus Torvalds
2009-04-27 11:10:24 -07:00
committed by Junio C Hamano
parent d649048e68
commit c922b01f54
2 changed files with 10 additions and 2 deletions

View File

@ -26,6 +26,10 @@ test_expect_success setup '
git commit -m initial
'
test_expect_success 'grep should not segfault with a bad input' '
test_must_fail git grep "("
'
for H in HEAD ''
do
case "$H" in