Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 59200 invoked by uid 500); 13 Mar 2001 10:22:35 -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 58711 invoked by uid 500); 13 Mar 2001 10:22:28 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 13 Mar 2001 10:22:24 -0000 Message-ID: <20010313102224.58522.qmail@apache.org> From: martin@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/main util.c martin 01/03/13 02:22:23 Modified: src CHANGES src/main util.c Log: Ignasi writes,... 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" Revision Changes Path 1.1665 +4 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1664 retrieving revision 1.1665 diff -u -u -r1.1664 -r1.1665 --- CHANGES 2001/03/09 10:10:09 1.1664 +++ CHANGES 2001/03/13 10:22:14 1.1665 @@ -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, ] + *) 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 1.195 +1 -2 apache-1.3/src/main/util.c Index: util.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/util.c,v retrieving revision 1.194 retrieving revision 1.195 diff -u -u -r1.194 -r1.195 --- util.c 2001/02/01 10:06:37 1.194 +++ util.c 2001/03/13 10:22:21 1.195 @@ -2040,7 +2040,6 @@ 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 @@ 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 */