@@ -12056,7 +12056,7 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
12056
12056
12057
12057
RExC_parse++; /* Skip past the '{' */
12058
12058
12059
- endbrace = strchr( RExC_parse, '}');
12059
+ endbrace = (char *) memchr( RExC_parse, '}', RExC_end - RExC_parse );
12060
12060
if (! endbrace) { /* no trailing brace */
12061
12061
vFAIL2("Missing right brace on \\%c{}", 'N');
12062
12062
}
@@ -12773,9 +12773,11 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
12773
12773
else {
12774
12774
STRLEN length;
12775
12775
char name = *RExC_parse;
12776
- char * endbrace;
12776
+ char * endbrace = NULL ;
12777
12777
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
+ }
12779
12781
12780
12782
if (! endbrace) {
12781
12783
vFAIL2("Missing right brace on \\%c{}", name);
@@ -16312,7 +16314,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
16312
16314
vFAIL2("Empty \\%c", (U8)value);
16313
16315
if (*RExC_parse == '{') {
16314
16316
const U8 c = (U8)value;
16315
- e = strchr( RExC_parse, '}');
16317
+ e = (char *) memchr( RExC_parse, '}', RExC_end - RExC_parse );
16316
16318
if (!e) {
16317
16319
RExC_parse++;
16318
16320
vFAIL2("Missing right brace on \\%c{}", c);
0 commit comments