Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-12-28 01:52:24 +0300
committerJunio C Hamano <gitster@pobox.com>2023-12-28 01:52:24 +0300
commitdb2cf6f3bbab88631d98ec737591b52ae4d87251 (patch)
tree061516d04736d609fbd6857b0a9f1ff1e1e401f4 /t
parentf09e74175dfa5b46587dab3c5dcbad16e9586de3 (diff)
parentd1bd3a8c3424e818f4117a39fe418909e24cea5f (diff)
Merge branch 'jk/mailinfo-oob-read-fix'
OOB read fix. * jk/mailinfo-oob-read-fix: mailinfo: fix out-of-bounds memory reads in unquote_quoted_pair()
Diffstat (limited to 't')
-rwxr-xr-xt/t5100-mailinfo.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index db11cababd..654d8cf3ee 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -268,4 +268,26 @@ test_expect_success 'mailinfo warn CR in base64 encoded email' '
test_must_be_empty quoted-cr/0002.err
'
+test_expect_success 'from line with unterminated quoted string' '
+ echo "From: bob \"unterminated string smith <bob@example.com>" >in &&
+ git mailinfo /dev/null /dev/null <in >actual &&
+ cat >expect <<-\EOF &&
+ Author: bob unterminated string smith
+ Email: bob@example.com
+
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'from line with unterminated comment' '
+ echo "From: bob (unterminated comment smith <bob@example.com>" >in &&
+ git mailinfo /dev/null /dev/null <in >actual &&
+ cat >expect <<-\EOF &&
+ Author: bob (unterminated comment smith
+ Email: bob@example.com
+
+ EOF
+ test_cmp expect actual
+'
+
test_done