httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1524167 - in /httpd/httpd/branches/2.4.x: ./ CHANGES modules/cache/cache_storage.c
Date Tue, 17 Sep 2013 18:43:30 GMT
Author: jim
Date: Tue Sep 17 18:43:30 2013
New Revision: 1524167

URL: http://svn.apache.org/r1524167
Log:
Merge r1523235 from trunk:

mod_cache: Avoid a crash with strcmp() when the hostname is not provided.

Submitted by: minfrin
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/modules/cache/cache_storage.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1523235

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1524167&r1=1524166&r2=1524167&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Tue Sep 17 18:43:30 2013
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.7
 
+  *) mod_cache: Avoid a crash with strcmp() when the hostname is not provided.
+     [Graham Leggett]
+
   *) mod_headers: Add 'Header note header-name note-name' for copying a response
      headers value into a note. [Eric Covener]
 

Modified: httpd/httpd/branches/2.4.x/modules/cache/cache_storage.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/cache_storage.c?rev=1524167&r1=1524166&r2=1524167&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/cache_storage.c (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/cache_storage.c Tue Sep 17 18:43:30 2013
@@ -713,7 +713,9 @@ int cache_invalidate(cache_request_rec *
                 || APR_SUCCESS
                         != cache_canonicalise_key(r, r->pool, location,
                                 &location_uri, &location_key)
-                || strcmp(r->parsed_uri.hostname, location_uri.hostname)) {
+                || !(r->parsed_uri.hostname && location_uri.hostname
+                        && !strcmp(r->parsed_uri.hostname,
+                                location_uri.hostname))) {
             location_key = NULL;
         }
     }
@@ -726,8 +728,9 @@ int cache_invalidate(cache_request_rec *
                 || APR_SUCCESS
                         != cache_canonicalise_key(r, r->pool, content_location,
                                 &content_location_uri, &content_location_key)
-                || strcmp(r->parsed_uri.hostname,
-                        content_location_uri.hostname)) {
+                || !(r->parsed_uri.hostname && content_location_uri.hostname
+                        && !strcmp(r->parsed_uri.hostname,
+                                content_location_uri.hostname))) {
             content_location_key = NULL;
         }
     }



Mime
View raw message