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