summaryrefslogtreecommitdiff
path: root/t/t0020-crlf.sh
diff options
context:
space:
mode:
authorSteffen Prohaska <prohaska@zib.de>2007-10-18 20:02:35 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-19 01:11:27 (GMT)
commitd7b0a09316fe8dcb62ad247dbbb45c3c777667ad (patch)
treea502781dd4cb2d46d3e4937263e61866ada2f66d /t/t0020-crlf.sh
parent415e7b877c54440bf92137a7021416efdf0a29b5 (diff)
downloadgit-d7b0a09316fe8dcb62ad247dbbb45c3c777667ad.zip
git-d7b0a09316fe8dcb62ad247dbbb45c3c777667ad.tar.gz
git-d7b0a09316fe8dcb62ad247dbbb45c3c777667ad.tar.bz2
attr: fix segfault in gitattributes parsing code
git may segfault if gitattributes contains an invalid entry. A test is added to t0020 that triggers the segfault. The parsing code is fixed to avoid the crash. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 't/t0020-crlf.sh')
-rwxr-xr-xt/t0020-crlf.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index 0807d9f..62bc4bb 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -371,4 +371,11 @@ test_expect_success 'in-tree .gitattributes (4)' '
}
'
+test_expect_success 'invalid .gitattributes (must not crash)' '
+
+ echo "three +crlf" >>.gitattributes &&
+ git diff
+
+'
+
test_done