]> granicus.if.org Git - apache/commitdiff
Fix a potential segfault on all platforms. David Reid fixed this for
authorRyan Bloom <rbb@apache.org>
Sun, 11 Feb 2001 00:51:38 +0000 (00:51 +0000)
committerRyan Bloom <rbb@apache.org>
Sun, 11 Feb 2001 00:51:38 +0000 (00:51 +0000)
BEOS, but this could actually happen on any platform, so we should
be safe and protect ourselves.
Submitted by: Cliff Woolley <cliffwoolley@yahoo.com>
Reviewed by: Ryan Bloom

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88080 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/util.c

diff --git a/CHANGES b/CHANGES
index 9d708844a868236122aa528751fad15af5c08a2d..f76bfb5fe4b9676ad57825b3ccb41cd8b7385284 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
 Changes with Apache 2.0b1
+
+  *) Fix a potential seg fault on all platforms.  David Reid fixed this
+     on BEOS, but the problem could happen anywhere, so we don't want
+     to #ifdef it. [Cliff Woolley <cliffwoolley@yahoo.com>]
   *) Add new LogFormat directive, %D, to log time it takes to serve a
      request in microseconds. [Bill Stoddard]
 
index 012886e2d7ba40944693a92876f7325a0261d669..29d61dbe53cb24a75494a9a1fc1d3f6c178a2abb 100644 (file)
@@ -1788,11 +1788,7 @@ char *ap_get_local_host(apr_pool_t *a)
         if ((!(p = gethostbyname(str))) 
             || (!(server_hostname = find_fqdn(a, p)))) {
             /* Recovery - return the default servername by IP: */
-#ifndef BEOS
-            if (p->h_addr_list[0]) {
-#else
-            if (p) {
-#endif
+            if (p && p->h_addr_list[0]) {
                 apr_snprintf(str, sizeof(str), "%pA", p->h_addr_list[0]);
                server_hostname = apr_pstrdup(a, str);
                 /* We will drop through to report the IP-named server */