b8876f
From 2c2da8e7f0f6325fab643997a536072633fa0cf8 Mon Sep 17 00:00:00 2001
b8876f
From: Yves Orton <demerphq@gmail.com>
b8876f
Date: Thu, 1 Jun 2017 14:51:44 +0200
b8876f
Subject: [PATCH] Fix #131190 - UTF8 code improperly casting negative integer
b8876f
 to U8 in comparison
b8876f
MIME-Version: 1.0
b8876f
Content-Type: text/plain; charset=UTF-8
b8876f
Content-Transfer-Encoding: 8bit
b8876f
b8876f
This reverts commit b4972372a75776de3c9e6bd234a398d103677316,
b8876f
effectively restoring commit ca7eb79a236b41b7722c6800527f95cd76843eed,
b8876f
and commit 85fde2b7c3f5631fd982f5db735b84dc9224bec0.
b8876f
b8876f
Signed-off-by: Petr Písař <ppisar@redhat.com>
b8876f
---
b8876f
 regexec.c | 1 +
b8876f
 1 file changed, 1 insertion(+)
b8876f
b8876f
diff --git a/regexec.c b/regexec.c
b8876f
index 82128a7..35b88d7 100644
b8876f
--- a/regexec.c
b8876f
+++ b/regexec.c
b8876f
@@ -5593,6 +5593,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
b8876f
                 if (scan->flags == EXACTL || scan->flags == EXACTFLU8) {
b8876f
                     _CHECK_AND_WARN_PROBLEMATIC_LOCALE;
b8876f
                     if (utf8_target
b8876f
+                        && nextchr >= 0 /* guard against negative EOS value in nextchr */
b8876f
                         && UTF8_IS_ABOVE_LATIN1(nextchr)
b8876f
                         && scan->flags == EXACTL)
b8876f
                     {
b8876f
-- 
b8876f
2.9.4
b8876f