summaryrefslogtreecommitdiff
path: root/libexec/httpd
diff options
context:
space:
mode:
authorshm <shm@NetBSD.org>2014-11-21 08:54:12 +0000
committershm <shm@NetBSD.org>2014-11-21 08:54:12 +0000
commit99fd2e8bbfa1137ed87805df687d153a95b2cd52 (patch)
treed492cc6503bba8c345e724bd2c4910313fb227d1 /libexec/httpd
parentff8545f79ae324d5b14f61c3d28057f04a26321f (diff)
Fixed off-by-one in virtualhost processing. Previous code was checking if
Host header is a prefix of any existing vhost. This behaviour might be used to uncover existing vitual hosts from the remote. OK @mrg
Diffstat (limited to 'libexec/httpd')
-rw-r--r--libexec/httpd/bozohttpd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c
index a9056a40fe1..9c08f00e461 100644
--- a/libexec/httpd/bozohttpd.c
+++ b/libexec/httpd/bozohttpd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.c,v 1.57 2014/10/10 05:10:59 mrg Exp $ */
+/* $NetBSD: bozohttpd.c,v 1.58 2014/11/21 08:54:12 shm Exp $ */
/* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */
@@ -1093,8 +1093,8 @@ check_virtual(bozo_httpreq_t *request)
}
debug((httpd, DEBUG_OBESE, "looking at dir``%s''",
d->d_name));
- if (strncasecmp(d->d_name, request->hr_host,
- len) == 0) {
+ if (d->d_namlen == len && strcmp(d->d_name,
+ request->hr_host) == 0) {
/* found it, punch it */
debug((httpd, DEBUG_OBESE, "found it punch it"));
request->hr_virthostname =