@@ -12056,7 +12056,7 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
1205612056
1205712057 RExC_parse++; /* Skip past the '{' */
1205812058
12059- endbrace = strchr( RExC_parse, '}');
12059+ endbrace = (char *) memchr( RExC_parse, '}', RExC_end - RExC_parse );
1206012060 if (! endbrace) { /* no trailing brace */
1206112061 vFAIL2("Missing right brace on \\%c{}", 'N');
1206212062 }
@@ -12773,9 +12773,11 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
1277312773 else {
1277412774 STRLEN length;
1277512775 char name = *RExC_parse;
12776- char * endbrace;
12776+ char * endbrace = NULL ;
1277712777 RExC_parse += 2;
12778- endbrace = strchr(RExC_parse, '}');
12778+ if (RExC_parse < RExC_end) {
12779+ endbrace = (char *) memchr(RExC_parse, '}', RExC_end - RExC_parse);
12780+ }
1277912781
1278012782 if (! endbrace) {
1278112783 vFAIL2("Missing right brace on \\%c{}", name);
@@ -16312,7 +16314,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
1631216314 vFAIL2("Empty \\%c", (U8)value);
1631316315 if (*RExC_parse == '{') {
1631416316 const U8 c = (U8)value;
16315- e = strchr( RExC_parse, '}');
16317+ e = (char *) memchr( RExC_parse, '}', RExC_end - RExC_parse );
1631616318 if (!e) {
1631716319 RExC_parse++;
1631816320 vFAIL2("Missing right brace on \\%c{}", c);
0 commit comments