From 85e11dedc109285e715203adbfe0362bf5d926f8 Mon Sep 17 00:00:00 2001 From: Rainer Jung Date: Sat, 11 Feb 2012 23:00:36 +0000 Subject: [PATCH] BZ 52623: Fix building against PCRE 8.30. PCRE dropped support for pcre_info() which is deprecated since a long time. Use pcre_fullinfo() instead, which exists since version 3.0 of PCRE. Patch provided by Ruediger Pluem. Backport of r1243176 from trunk. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1243177 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ include/ap_mmn.h | 5 +++-- include/ap_regex.h | 2 +- server/util_pcre.c | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index bcd405b0e5..e9e43832f2 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,9 @@ Changes with Apache 2.4.1 *) Doxygen fixes and improvements. [Joe Orton, Igor Galić] + *) core: Fix building against PCRE 8.30 by switching from the obsolete + pcre_info() to pcre_fullinfo(). PR 52623 [Ruediger Pluem, Rainer Jung] + Changes with Apache 2.4.0 *) SECURITY: CVE-2012-0031 (cve.mitre.org) diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 207fb059bb..31bfbc4e07 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -389,14 +389,15 @@ * private; * move core_net rec definition to http_core.h; * add insert_network_bucket hook, AP_DECLINED + * 20120211.0 (2.4.1-dev) Change re_nsub in ap_regex_t from apr_size_t to int. */ #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 20120109 +#define MODULE_MAGIC_NUMBER_MAJOR 20120211 #endif -#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/ap_regex.h b/include/ap_regex.h index 787dc599a9..5122154d90 100644 --- a/include/ap_regex.h +++ b/include/ap_regex.h @@ -88,7 +88,7 @@ enum { /* 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; diff --git a/server/util_pcre.c b/server/util_pcre.c index 7196878d0c..2d157c0c10 100644 --- a/server/util_pcre.c +++ b/server/util_pcre.c @@ -139,7 +139,8 @@ AP_DECLARE(int) ap_regcomp(ap_regex_t * preg, const char *pattern, int cflags) 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; } -- 2.40.0