From: chrisz Date: Wed, 13 Aug 2014 08:08:55 +0000 (+0000) Subject: fix early loop termination in httpd path_info() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=59346113693dde74e8d7e9d63613dc9590410604;p=openbsd 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. --- 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 @@ -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)