You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/08/27 21:51:34 UTC
cvs commit: httpd-2.0/server vhost.c
trawick 01/08/27 12:51:34
Modified: . CHANGES
server vhost.c
Log:
Fix a segfault when a numeric host (e.g., "Host: 123") was specified.
apr_parse_addr_port() assumes that if there is just a number it must
be a port, but here we need to assume that it is a host.
todo: pass a flag into apr_parse_addr_port()? unclear whether or
not that is cleaner overall
Revision Changes Path
1.335 +3 -0 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.334
retrieving revision 1.335
diff -u -r1.334 -r1.335
--- CHANGES 2001/08/27 14:43:19 1.334
+++ CHANGES 2001/08/27 19:51:34 1.335
@@ -1,5 +1,8 @@
Changes with Apache 2.0.25-dev
+ *) Fix a segfault when a numeric value was received for Host:.
+ [Jeff Trawick]
+
*) Add a function ap_remove_input_filter. This is to match
up with ap_remove_output_filter. [Ryan Bloom]
1.58 +8 -0 httpd-2.0/server/vhost.c
Index: vhost.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- vhost.c 2001/02/24 11:23:22 1.57
+++ vhost.c 2001/08/27 19:51:34 1.58
@@ -734,6 +734,14 @@
goto bad;
}
+ if (!host && port) {
+ /* silly looking host ("Host: 123") but that isn't our job
+ * here to judge; apr_parse_addr_port() would think we had a port
+ * but no address
+ */
+ host = apr_psprintf(r->pool, "%d", (int)port);
+ }
+
/* if the hostname is an IPv6 numeric address string, it was validated
* already; otherwise, further validation is needed
*/