From 7a64f2f888c9e36f95ac032cfa6c9e488fdaf11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Wed, 27 Aug 2008 15:59:50 +0000 Subject: [PATCH] fix segfault for stat_cache(fam) calls with relative path (without '/', can be triggered by x-sendfile) (#1750) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2299 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/stat_cache.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 96ae0498..aaa688e9 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,7 @@ NEWS * fixed mem leak in ssi expression parser (#1753), thx Take5k * hide some ssl errors per default, enable them with debug.log-ssl-noise (#397) * do not send content-encoding for 304 (#1754), thx yzlai + * fix segfault for stat_cache(fam) calls with relative path (without '/', can be triggered by x-sendfile) (#1750) - 1.4.19 - 2008-03-10 diff --git a/src/stat_cache.c b/src/stat_cache.c index 9325693d..fa94eede 100644 --- a/src/stat_cache.c +++ b/src/stat_cache.c @@ -445,7 +445,9 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_ /* dir-check */ if (srv->srvconf.stat_cache_engine == STAT_CACHE_ENGINE_FAM) { if (0 != buffer_copy_dirname(sc->dir_name, name)) { - SEGFAULT(); + log_error_write(srv, __FILE__, __LINE__, "sb", + "no '/' found in filename:", name); + return HANDLER_ERROR; } buffer_copy_string_buffer(sc->hash_key, sc->dir_name);