You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gr...@apache.org on 2001/10/15 17:32:14 UTC

cvs commit: httpd-2.0/server vhost.c

gregames    01/10/15 08:32:14

  Modified:    server   vhost.c
  Log:
  insure that a '*' in <VirtualHost *> or NameVirtualHost * matches all ports.
  
  The recent change to eliminate the Port directive exposed this problem.
  
  Revision  Changes    Path
  1.59      +10 -7     httpd-2.0/server/vhost.c
  
  Index: vhost.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- vhost.c	2001/08/27 19:51:34	1.58
  +++ vhost.c	2001/10/15 15:32:14	1.59
  @@ -194,13 +194,16 @@
   
       w = apr_pstrdup(p, w_);
       /* apr_parse_addr_port() doesn't understand ":*" so handle that first. */
  -    wlen = strlen(w);
  -    if (wlen > 2 && w[wlen - 1] == '*' && w[wlen - 2] == ':') {
  -        w[wlen - 2] = '\0';
  -        wild_port = 1;
  -    }
  -    else {
  -        wild_port = 0;
  +    wlen = strlen(w);                    /* wlen must be > 0 at this point */
  +    wild_port = 0;
  +    if (w[wlen - 1] == '*') {
  +        if (wlen < 2) {
  +            wild_port = 1;
  +        }
  +        else if (w[wlen - 2] == ':') {
  +            w[wlen - 2] = '\0';
  +            wild_port = 1;
  +        }
       }
       rv = apr_parse_addr_port(&host, &scope_id, &port, w, p);
       if (rv != APR_SUCCESS) {