https://issues.apache.org/bugzilla/show_bug.cgi?id=52623
--- Comment #2 from Ruediger Pluem <[email protected]> 2012-02-08 08:34:43 UTC --- (In reply to comment #1) > This might be the correct fix: > > --- server/util_pcre.c 2005-11-10 16:20:05.000000000 +0100 > +++ server/util_pcre.c.oden 2012-02-07 10:47:42.382844294 +0100 > @@ -137,7 +137,7 @@ preg->re_erroffset = erroffset; > > if (preg->re_pcre == NULL) return AP_REG_INVARG; > > -preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); > +preg->re_nsub = pcre_fullinfo((const pcre *)preg->re_pcre, NULL, NULL, NULL); > return 0; > } I think this fix is wrong. IMHO it should be: Index: server/util_pcre.c =================================================================== --- server/util_pcre.c (revision 1241805) +++ server/util_pcre.c (working copy) @@ -124,6 +124,7 @@ const char *errorptr; int erroffset; int options = 0; + int nsub; if ((cflags & AP_REG_ICASE) != 0) options |= PCRE_CASELESS; @@ -139,7 +140,9 @@ if (preg->re_pcre == NULL) return AP_REG_INVARG; - preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); + pcre_fullinfo((const pcre *)preg->re_pcre, NULL, + PCRE_INFO_CAPTURECOUNT, &nsub); + preg->re_nsub = nsub; return 0; } or even better: Index: server/util_pcre.c =================================================================== --- server/util_pcre.c (revision 1241805) +++ server/util_pcre.c (working copy) @@ -139,7 +139,8 @@ if (preg->re_pcre == NULL) return AP_REG_INVARG; - preg->re_nsub = pcre_info((const pcre *)preg->re_pcre, NULL, NULL); + pcre_fullinfo((const pcre *)preg->re_pcre, NULL, + PCRE_INFO_CAPTURECOUNT, &(preg->re_nsub)); return 0; } Index: include/ap_regex.h =================================================================== --- include/ap_regex.h (revision 1241805) +++ include/ap_regex.h (working copy) @@ -88,7 +88,7 @@ /* The structure representing a compiled regular expression. */ typedef struct { void *re_pcre; - apr_size_t re_nsub; + int re_nsub; apr_size_t re_erroffset; } ap_regex_t; but this requires a major bump since it changes a public API. Can you please test the above patches? -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
