You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2012/01/04 21:03:12 UTC
svn commit: r1227292 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS
modules/loggers/mod_log_config.c
Author: sf
Date: Wed Jan 4 20:03:11 2012
New Revision: 1227292
URL: http://svn.apache.org/viewvc?rev=1227292&view=rev
Log:
Merge r1225380:
Fix segfault when logging nameless, valueless cookie
PR: 52256
Reviewed by: Stefan Fritsch, Greg Ames, Eric Covener
Modified:
httpd/httpd/branches/2.2.x/CHANGES
httpd/httpd/branches/2.2.x/STATUS
httpd/httpd/branches/2.2.x/modules/loggers/mod_log_config.c
Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1227292&r1=1227291&r2=1227292&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Jan 4 20:03:11 2012
@@ -11,6 +11,9 @@ Changes with Apache 2.2.22
is enabled, could allow local users to gain privileges via a .htaccess
file. [Stefan Fritsch, Greg Ames]
+ *) mod_log_config: Fix segfault when logging nameless, valueless cookie.
+ PR 52256. [Stefan Fritsch]
+
*) core: Fix segfault in ap_send_interim_response(). PR 52315.
[Stefan Fritsch]
Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1227292&r1=1227291&r2=1227292&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Jan 4 20:03:11 2012
@@ -107,11 +107,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
and 2.4.x no longer support this version, see r1203491 and r1203495)
+1: kbrand (non-binding), rjung, jorton
- * mod_log_config: Fix segfault when logging Nameless, Valueless cookie. PR 52256
- Trunk patch: http://svn.apache.org/viewvc?rev=1225380&view=rev
- 2.2.x patch: trunk patch works
- +1: sf, gregames, covener
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
Modified: httpd/httpd/branches/2.2.x/modules/loggers/mod_log_config.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/loggers/mod_log_config.c?rev=1227292&r1=1227291&r2=1227292&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/loggers/mod_log_config.c (original)
+++ httpd/httpd/branches/2.2.x/modules/loggers/mod_log_config.c Wed Jan 4 20:03:11 2012
@@ -524,19 +524,21 @@ static const char *log_cookie(request_re
while ((cookie = apr_strtok(cookies, ";", &last1))) {
char *name = apr_strtok(cookie, "=", &last2);
- char *value;
- apr_collapse_spaces(name, name);
+ if (name) {
+ char *value;
+ apr_collapse_spaces(name, name);
+
+ if (!strcasecmp(name, a) && (value = apr_strtok(NULL, "=", &last2))) {
+ char *last;
+ value += strspn(value, " \t"); /* Move past leading WS */
+ last = value + strlen(value) - 1;
+ while (last >= value && apr_isspace(*last)) {
+ *last = '\0';
+ --last;
+ }
- if (!strcasecmp(name, a) && (value = apr_strtok(NULL, "=", &last2))) {
- char *last;
- value += strspn(value, " \t"); /* Move past leading WS */
- last = value + strlen(value) - 1;
- while (last >= value && apr_isspace(*last)) {
- *last = '\0';
- --last;
+ return ap_escape_logitem(r->pool, value);
}
-
- return ap_escape_logitem(r->pool, value);
}
cookies = NULL;
}