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