diff options
author | Christopher Zimmermann <chrisz@cvs.openbsd.org> | 2014-08-13 08:08:56 +0000 |
---|---|---|
committer | Christopher Zimmermann <chrisz@cvs.openbsd.org> | 2014-08-13 08:08:56 +0000 |
commit | e4096ac8efe9be7e191067bab520ba1be8249c30 (patch) | |
tree | 1f6c0c78a5a8005d8fc760c9b73ec024126d5bbe | |
parent | 1ac44a1c2eaa4250a4e288e7d2c610d264e9f1a1 (diff) |
fix early loop termination in httpd path_info()
without this fix httpd always put at least the first
path component in SCRIPT_NAME even when it did not exist.
Now for completely non-existant paths everything goes into
PATH_INFO.
-rw-r--r-- | usr.sbin/httpd/httpd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/httpd/httpd.c b/usr.sbin/httpd/httpd.c index 220f5375a68..d5ca6e4067c 100644 --- a/usr.sbin/httpd/httpd.c +++ b/usr.sbin/httpd/httpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: httpd.c,v 1.17 2014/08/05 15:36:59 reyk Exp $ */ +/* $OpenBSD: httpd.c,v 1.18 2014/08/13 08:08:55 chrisz Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -593,7 +593,7 @@ path_info(char *name) start = path; end = start + strlen(path); - for (p = end; p > start; p--) { + for (p = end; p >= start; p--) { if (*p != '/') continue; if (stat(path, &st) == 0) |