From f9a1287c612ae0ef538428c5c9da7de4a21c5104 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Sun, 11 Feb 2001 00:51:38 +0000 Subject: [PATCH] Fix a potential segfault on all platforms. David Reid fixed this for BEOS, but this could actually happen on any platform, so we should be safe and protect ourselves. Submitted by: Cliff Woolley Reviewed by: Ryan Bloom git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88080 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ server/util.c | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 9d708844a8..f76bfb5fe4 100644 --- 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 ] + *) Add new LogFormat directive, %D, to log time it takes to serve a request in microseconds. [Bill Stoddard] diff --git a/server/util.c b/server/util.c index 012886e2d7..29d61dbe53 100644 --- a/server/util.c +++ b/server/util.c @@ -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 */ -- 2.50.1