78f1eb
From 31532982b04c20a43aa9c3d26780e3591c524fbc Mon Sep 17 00:00:00 2001
78f1eb
From: Karl Williamson <khw@cpan.org>
78f1eb
Date: Thu, 27 Jun 2019 15:39:11 -0600
78f1eb
Subject: [PATCH] regcomp.c: Don't read off the end of buffer
78f1eb
MIME-Version: 1.0
78f1eb
Content-Type: text/plain; charset=UTF-8
78f1eb
Content-Transfer-Encoding: 8bit
78f1eb
78f1eb
Until this commit, it was possible that \p{nv=3/} would cause the right
78f1eb
brace to be considered part of the property name.
78f1eb
78f1eb
Spotted by Hugo van der Sanden
78f1eb
78f1eb
Signed-off-by: Petr Písař <ppisar@redhat.com>
78f1eb
---
78f1eb
 regcomp.c | 4 +++-
78f1eb
 1 file changed, 3 insertions(+), 1 deletion(-)
78f1eb
78f1eb
diff --git a/regcomp.c b/regcomp.c
78f1eb
index 1117998fc8..cf9246473f 100644
78f1eb
--- a/regcomp.c
78f1eb
+++ b/regcomp.c
78f1eb
@@ -23092,7 +23092,9 @@ Perl_parse_uniprop_string(pTHX_
78f1eb
             }
78f1eb
 
78f1eb
             /* Store the first real character in the denominator */
78f1eb
-            lookup_name[j++] = name[i];
78f1eb
+            if (i < name_len) {
78f1eb
+                lookup_name[j++] = name[i];
78f1eb
+            }
78f1eb
         }
78f1eb
     }
78f1eb
 
78f1eb
-- 
78f1eb
2.21.0
78f1eb