apply: check git diffs for missing old filenames
authorRené Scharfe <l.s.r@web.de>
Tue, 27 Jun 2017 17:03:30 +0000 (19:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Jun 2017 17:58:30 +0000 (10:58 -0700)
commit4269974179ff4fc2a970c972330ba5b7f26a323b
tree86b9aa02c0176cf03b2aab35eff21c586c897d5c
parent773e3a2e0226cffac6c813c2d3bea5ba480675d8
apply: check git diffs for missing old filenames

2c93286a (fix "git apply --index ..." not to deref NULL) added a check
for git patches missing a +++ line, preventing a segfault.  Check for
missing --- lines as well, and add a test for each case.

Found by Vegard Nossum using AFL.

Original-patch-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
apply.c
t/t4133-apply-filenames.sh