]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Ignasi writes,...
authorMartin Kraemer <martin@apache.org>
Tue, 13 Mar 2001 10:22:21 +0000 (10:22 +0000)
committerMartin Kraemer <martin@apache.org>
Tue, 13 Mar 2001 10:22:21 +0000 (10:22 +0000)
  The first correction is not important, only removes a redundant line,
  the ap_pstrdup(a, "127.0.0.1") is done anyway at the end of the function.
  The second correction is really a bug the p-> can be NULL.

Submitted by: "Roca Carrio, Ignasi" <Ignasi.Roca@fujitsu-siemens.com>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@88509 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/main/util.c

index 9899ae1e65689c0657b9dc460c00861232ffc4ec..8c26c10a248f2ad9defbb77b013d17b0eff018c6 100644 (file)
@@ -1,5 +1,9 @@
 Changes with Apache 1.3.20
 
+  *) Fix a possible NULL pointer dereference in the detection of the
+     default ServerName or IP string (introduced in 1.3.18).
+     [Ignasi Roca, <Ignasi.Roca@fujitsu-siemens.com>]
+
   *) Make EBCDIC conversion fully configurable. Until now, apache relied
      on some (incomplete) heuristics, and would fail to correctly serve
      text files when they had a MIME type of application/anything, like
index fb3347f96c4ccf9c2a1382577015f1b503e5e17a..8c056f06c824f0e7fbb07b12dce913f9afa0f532 100644 (file)
@@ -2040,7 +2040,6 @@ char *ap_get_local_host(pool *a)
        ap_log_error(APLOG_MARK, APLOG_WARNING, NULL,
                     "%s: gethostname() failed to determine ServerName\n",
                      ap_server_argv0);
-       server_hostname = ap_pstrdup(a, "127.0.0.1");
     }
     else 
     {
@@ -2048,7 +2047,7 @@ char *ap_get_local_host(pool *a)
         if ((!(p = gethostbyname(str))) 
             || (!(server_hostname = find_fqdn(a, p)))) {
             /* Recovery - return the default servername by IP: */
-            if (p->h_addr_list[0]) {
+            if (p && p->h_addr_list[0]) {
                 ap_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]);
                server_hostname = ap_pstrdup(a, str);
                 /* We will drop through to report the IP-named server */