diff --git a/regcomp.c b/regcomp.c index 7bbfec091518..2939502bb729 100644 --- a/regcomp.c +++ b/regcomp.c @@ -22728,7 +22728,8 @@ Perl_parse_uniprop_string(pTHX_ pos_in_brackets = strchr("([<)]>)]>", open); close = (pos_in_brackets) ? pos_in_brackets[3] : open; - if ( name[name_len-1] != close + if ( i >= name_len + || name[name_len-1] != close || (escaped && name[name_len-2] != '\\')) { sv_catpvs(msg, "Unicode property wildcard not terminated"); diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t index 1808d35aa558..290dc244c288 100644 --- a/t/re/pat_advanced.t +++ b/t/re/pat_advanced.t @@ -2512,6 +2512,13 @@ EOF "Assertion failure with *COMMIT and wildcard property"); } + { # [perl #134029] Previously assertion failure + fresh_perl_like('qr/\p{upper:]}|\337(?|ss)|)(?0/', + qr/Unicode property wildcard not terminated/, + {}, + "Assertion failure with single character wildcard"); + } + # !!! NOTE that tests that aren't at all likely to crash perl should go # a ways above, above these last ones. There's a comment there that, like