aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'server.c')
-rw-r--r--server.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server.c b/server.c
index 473e111..e07d6bc 100644
--- a/server.c
+++ b/server.c
@@ -406,8 +406,12 @@ check_for_cgi(struct client *c)
* dirname, with its ambiguities on if the given
* pointer is changed or not, gives me headaches.
*/
- while (*end != '/')
+ while (*end != '/' && end > path)
end--;
+
+ if (end == path)
+ break;
+
*end = '\0';
switch (check_path(c, path, &c->pfd)) {