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