pcre2/pcre2-10.32-Fix-subject-buffer-overread-in-JIT.-Found-by-Yunho-K.patch

35 lines
1.1 KiB
Diff
Raw Normal View History

From f3b9337a2280db816ef6b2cbe3750b2991944c22 Mon Sep 17 00:00:00 2001
From: zherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>
Date: Tue, 18 Sep 2018 10:19:14 +0000
Subject: [PATCH] Fix subject buffer overread in JIT. Found by Yunho Kim.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1011 6239d852-aaf2-0410-a92c-79f79f948069
Petr Písař: Ported to 10.32. The tests were removed because they need
a new test framework not availanble in 10.32.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
src/pcre2_jit_compile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 32e985b..b3015cc 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -9951,7 +9951,7 @@ if (exact > 1)
#ifdef SUPPORT_UNICODE
&& !common->utf
#endif
- )
+ && type != OP_ANYNL && type != OP_EXTUNI)
{
OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact));
add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0));
--
2.17.1