|
|
08805a |
From 644e923aee63090fd4f68169940327d9eebedc33 Mon Sep 17 00:00:00 2001
|
|
|
08805a |
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
|
|
08805a |
Date: Tue, 23 Jun 2015 16:34:53 +0000
|
|
|
08805a |
Subject: [PATCH] Fix buffer overflow for forward reference within backward
|
|
|
08805a |
assertion with excess closing parenthesis. Bugzilla 1651.
|
|
|
08805a |
MIME-Version: 1.0
|
|
|
08805a |
Content-Type: text/plain; charset=UTF-8
|
|
|
08805a |
Content-Transfer-Encoding: 8bit
|
|
|
08805a |
|
|
|
08805a |
This is upstream commit ported to 8.32:
|
|
|
08805a |
|
|
|
08805a |
commit 764692f9aea9eab50fdba6cb537441d8b34c6c37
|
|
|
08805a |
Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
|
|
08805a |
Date: Tue Jun 23 16:34:53 2015 +0000
|
|
|
08805a |
|
|
|
08805a |
Fix buffer overflow for forward reference within backward assertion with excess
|
|
|
08805a |
closing parenthesis. Bugzilla 1651.
|
|
|
08805a |
|
|
|
08805a |
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1571 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
|
|
08805a |
|
|
|
08805a |
It fixes CVE-2015-5073.
|
|
|
08805a |
|
|
|
08805a |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
08805a |
---
|
|
|
08805a |
pcre_compile.c | 2 +-
|
|
|
08805a |
testdata/testinput2 | 2 ++
|
|
|
08805a |
testdata/testoutput2 | 3 +++
|
|
|
08805a |
3 files changed, 6 insertions(+), 1 deletion(-)
|
|
|
08805a |
|
|
|
08805a |
diff --git a/pcre_compile.c b/pcre_compile.c
|
|
|
08805a |
index d570447..aa7f4d6 100644
|
|
|
08805a |
--- a/pcre_compile.c
|
|
|
08805a |
+++ b/pcre_compile.c
|
|
|
08805a |
@@ -8275,7 +8275,7 @@ OP_RECURSE that are not fixed length get a diagnosic with a useful offset. The
|
|
|
08805a |
exceptional ones forgo this. We scan the pattern to check that they are fixed
|
|
|
08805a |
length, and set their lengths. */
|
|
|
08805a |
|
|
|
08805a |
-if (cd->check_lookbehind)
|
|
|
08805a |
+if (errorcode == 0 && cd->check_lookbehind)
|
|
|
08805a |
{
|
|
|
08805a |
pcre_uchar *cc = (pcre_uchar *)codestart;
|
|
|
08805a |
|
|
|
08805a |
diff --git a/testdata/testinput2 b/testdata/testinput2
|
|
|
08805a |
index fc6fe2f..2f460dc 100644
|
|
|
08805a |
--- a/testdata/testinput2
|
|
|
08805a |
+++ b/testdata/testinput2
|
|
|
08805a |
@@ -3827,4 +3827,6 @@ settings of the anchored and startline bits. --/
|
|
|
08805a |
|
|
|
08805a |
/^(?:(?(1)x|)+)+$()/BZ
|
|
|
08805a |
|
|
|
08805a |
+/(?=di(?<=(?1))|(?=(.))))/
|
|
|
08805a |
+
|
|
|
08805a |
/-- End of testinput2 --/
|
|
|
08805a |
diff --git a/testdata/testoutput2 b/testdata/testoutput2
|
|
|
08805a |
index 63b39c2..3c09fdf 100644
|
|
|
08805a |
--- a/testdata/testoutput2
|
|
|
08805a |
+++ b/testdata/testoutput2
|
|
|
08805a |
@@ -12540,4 +12540,7 @@ No match
|
|
|
08805a |
End
|
|
|
08805a |
------------------------------------------------------------------
|
|
|
08805a |
|
|
|
08805a |
+/(?=di(?<=(?1))|(?=(.))))/
|
|
|
08805a |
+Failed: unmatched parentheses at offset 23
|
|
|
08805a |
+
|
|
|
08805a |
/-- End of testinput2 --/
|
|
|
08805a |
--
|
|
|
08805a |
2.5.5
|
|
|
08805a |
|