From 391999744771002cb5feded004879f36534b9b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 21 Apr 2020 06:54:36 +0700 Subject: mailinfo: disallow NUL character in mail's header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Đoàn Trần Công Danh Signed-off-by: Junio C Hamano --- t/t4254-am-corrupt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 't/t4254-am-corrupt.sh') diff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh index 1bbc37bc92..daf01c309d 100755 --- a/t/t4254-am-corrupt.sh +++ b/t/t4254-am-corrupt.sh @@ -70,10 +70,13 @@ test_expect_success "NUL in commit message's body" ' grep "a NUL byte in commit log message not allowed" err ' -test_expect_failure "NUL in commit message's header" " +test_expect_success "NUL in commit message's header" " test_when_finished 'git am --abort' && make_mbox_with_nul subject >subject.patch && - test_must_fail git am subject.patch + test_must_fail git mailinfo msg patch err && + grep \"a NUL byte in 'Subject' is not allowed\" err && + test_must_fail git am subject.patch 2>err && + grep \"a NUL byte in 'Subject' is not allowed\" err " test_done -- cgit v1.2.3