78f1eb
From 8d3e0237887e7149be56d17a9448cb465edc5f76 Mon Sep 17 00:00:00 2001
78f1eb
From: Karl Williamson <khw@cpan.org>
78f1eb
Date: Thu, 22 Aug 2019 10:16:14 -0600
78f1eb
Subject: [PATCH] regcomp.c: Fix wrong limit test
78f1eb
MIME-Version: 1.0
78f1eb
Content-Type: text/plain; charset=UTF-8
78f1eb
Content-Transfer-Encoding: 8bit
78f1eb
78f1eb
Spotted by Hugo van der Sanden in code reading.
78f1eb
78f1eb
Signed-off-by: Petr Písař <ppisar@redhat.com>
78f1eb
---
78f1eb
 regcomp.c | 2 +-
78f1eb
 1 file changed, 1 insertion(+), 1 deletion(-)
78f1eb
78f1eb
diff --git a/regcomp.c b/regcomp.c
78f1eb
index aba6648da5..d61fd434fe 100644
78f1eb
--- a/regcomp.c
78f1eb
+++ b/regcomp.c
78f1eb
@@ -23132,7 +23132,7 @@ Perl_parse_uniprop_string(pTHX_
78f1eb
 
78f1eb
     /* If the original input began with 'In' or 'Is', it could be a subroutine
78f1eb
      * call to a user-defined property instead of a Unicode property name. */
78f1eb
-    if (    non_pkg_begin + name_len > 2
78f1eb
+    if (    name_len - non_pkg_begin > 2
78f1eb
         &&  name[non_pkg_begin+0] == 'I'
78f1eb
         && (name[non_pkg_begin+1] == 'n' || name[non_pkg_begin+1] == 's'))
78f1eb
     {
78f1eb
-- 
78f1eb
2.21.0
78f1eb