From 387626e6ef074c4d4bde1d1a9ae9a7cd02cf122d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Sat, 11 Jul 2009 18:59:48 +0000 Subject: [PATCH] Avoid a NULL dereference when serving a request for the base url of a static content sub tree. --- src/webui/webui.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webui/webui.c b/src/webui/webui.c index 77a5f055..818b137d 100644 --- a/src/webui/webui.c +++ b/src/webui/webui.c @@ -87,6 +87,9 @@ page_static_file(http_connection_t *hc, const char *remain, void *opaque) struct stat st; const char *content = NULL, *postfix; + if(remain == NULL) + return 404; + if(strstr(remain, "..")) return HTTP_STATUS_BAD_REQUEST;