2013-06-06 15:35:18 +02:00
|
|
|
--- ./regcomp.c.orig 2013-05-10 02:30:48.000000000 +0000
|
|
|
|
+++ ./regcomp.c 2013-06-06 13:04:19.000000000 +0000
|
|
|
|
@@ -8998,7 +8998,7 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I
|
2008-08-21 18:46:31 +02:00
|
|
|
|
|
|
|
ret = reganode(pRExC_state, GOSUB, num);
|
|
|
|
if (!SIZE_ONLY) {
|
|
|
|
- if (num > (I32)RExC_rx->nparens) {
|
|
|
|
+ if (num < 0 || num > (I32)RExC_rx->nparens) {
|
|
|
|
RExC_parse++;
|
|
|
|
vFAIL("Reference to nonexistent group");
|
|
|
|
}
|
2013-06-06 15:35:18 +02:00
|
|
|
@@ -10654,7 +10654,7 @@ tryagain:
|
2008-08-21 18:46:31 +02:00
|
|
|
if (num < 1)
|
|
|
|
vFAIL("Reference to nonexistent or unclosed group");
|
|
|
|
}
|
|
|
|
- if (!isg && num > 9 && num >= RExC_npar)
|
|
|
|
+ if (!isg && (num < 0 || (num > 9 && num >= RExC_npar)))
|
2013-06-06 15:35:18 +02:00
|
|
|
/* Probably a character specified in octal, e.g. \35 */
|
2008-08-21 18:46:31 +02:00
|
|
|
goto defchar;
|
|
|
|
else {
|
2013-06-06 15:35:18 +02:00
|
|
|
@@ -10669,7 +10669,7 @@ tryagain:
|
2008-08-21 18:46:31 +02:00
|
|
|
RExC_parse++;
|
|
|
|
}
|
|
|
|
if (!SIZE_ONLY) {
|
|
|
|
- if (num > (I32)RExC_rx->nparens)
|
|
|
|
+ if (num < 0 || num > (I32)RExC_rx->nparens)
|
|
|
|
vFAIL("Reference to nonexistent group");
|
|
|
|
}
|
|
|
|
RExC_sawback = 1;
|
2013-06-06 15:35:18 +02:00
|
|
|
@@ -10934,7 +10934,7 @@ tryagain:
|
2008-08-21 18:46:31 +02:00
|
|
|
case '0': case '1': case '2': case '3':case '4':
|
2013-06-06 15:35:18 +02:00
|
|
|
case '5': case '6': case '7':
|
2008-08-21 18:46:31 +02:00
|
|
|
if (*p == '0' ||
|
2011-05-16 16:18:55 +02:00
|
|
|
- (isDIGIT(p[1]) && atoi(p) >= RExC_npar))
|
|
|
|
+ (isDIGIT(p[1]) && (U32)atoi(p) >= (U32)RExC_npar))
|
|
|
|
{
|
|
|
|
I32 flags = PERL_SCAN_SILENT_ILLDIGIT;
|
2008-08-21 18:46:31 +02:00
|
|
|
STRLEN numlen = 3;
|