Return-Path: Delivered-To: apmail-apache-cvs-archive@apache.org Received: (qmail 36176 invoked by uid 500); 23 Jan 2001 14:14:08 -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 36164 invoked by uid 500); 23 Jan 2001 14:14:07 -0000 Delivered-To: apmail-apache-1.3-cvs@apache.org Date: 23 Jan 2001 14:14:07 -0000 Message-ID: <20010123141407.36160.qmail@apache.org> From: fanf@apache.org To: apache-1.3-cvs@apache.org Subject: cvs commit: apache-1.3/src/main http_vhost.c fanf 01/01/23 06:14:07 Modified: src CHANGES src/main http_vhost.c Log: Fix the handling of port numbers in Host headers. Spotted by: coar Revision Changes Path 1.1623 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1622 retrieving revision 1.1623 diff -u -u -r1.1622 -r1.1623 --- CHANGES 2001/01/21 03:10:10 1.1622 +++ CHANGES 2001/01/23 14:14:04 1.1623 @@ -1,5 +1,8 @@ Changes with Apache 1.3.17 + *) Handle port numbers in Host headers properly again after + the code was broken in 1.3.15. [Tony Finch] + Changes with Apache 1.3.16 *) None from 1.3.15 1.25 +12 -8 apache-1.3/src/main/http_vhost.c Index: http_vhost.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/http_vhost.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -u -r1.24 -r1.25 --- http_vhost.c 2001/01/15 17:05:03 1.24 +++ http_vhost.c 2001/01/23 14:14:06 1.25 @@ -717,15 +717,19 @@ if (*src == '/' || *src == '\\') { goto bad; } + if (*src == ':') { + /* check the port part */ + while (*++src) { + if (!ap_isdigit(*src)) { + goto bad; + } + } + if (src[-1] == ':') + goto bad; + else + break; + } *dst++ = *src++; - } - /* check the port part */ - if (*src++ == ':') { - while (*src) { - if (!ap_isdigit(*src++)) { - goto bad; - } - } } /* strip trailing gubbins */ if (dst > host && dst[-1] == '.') {