From f24cf489b9d03955710ba61615bd447e3e6a1f12 Mon Sep 17 00:00:00 2001 From: lukasepple Date: Sun, 3 Jan 2016 21:33:45 +0100 Subject: Fix misdetection of lfi attacks --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index eab22ce..ca3ec9e 100644 --- a/main.c +++ b/main.c @@ -188,8 +188,8 @@ void blog_index(void) { } void blog_post(char post_path[]) { - if(strlen(post_path) != 0 || post_path[0] == '.' - || strchr(post_path, '/') == NULL) { + if(strlen(post_path) != 0 && (post_path[0] == '.' + || strchr(post_path, '/') == NULL)) { send_header("Content-type", "text/plain"); terminate_headers(); printf("No, my dear h4xxx0r :)\nYou won\'t do that :p\n"); -- cgit 1.4.1