Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 11713 invoked by uid 500); 11 Feb 2001 00:51:39 -0000 Mailing-List: contact apache-cvs-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list apache-cvs@apache.org Received: (qmail 11702 invoked by uid 500); 11 Feb 2001 00:51:39 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 11 Feb 2001 00:51:38 -0000 Message-ID: <20010211005138.11698.qmail@apache.org> From: rbb@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server util.c rbb 01/02/10 16:51:38 Modified: . CHANGES server util.c Log: 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 Revision Changes Path 1.85 +5 -0 httpd-2.0/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/httpd-2.0/CHANGES,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -b -w -u -r1.84 -r1.85 --- CHANGES 2001/02/10 03:38:47 1.84 +++ CHANGES 2001/02/11 00:51:38 1.85 @@ -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] 1.101 +1 -5 httpd-2.0/server/util.c Index: util.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/util.c,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -b -w -u -r1.100 -r1.101 --- util.c 2001/02/10 13:05:28 1.100 +++ util.c 2001/02/11 00:51:38 1.101 @@ -1788,11 +1788,7 @@ 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 */