From: Nick Kew Date: Sat, 27 Oct 2007 18:51:23 +0000 (+0000) Subject: Fix possible crash at startup in case of nonexistent DocumentRoot. X-Git-Tag: 2.3.0~1307 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2aa4ac4da582fb13ae21a36a4d3a07c624daf23b;p=apache Fix possible crash at startup in case of nonexistent DocumentRoot. PR#39722 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@589177 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index ff41efe51f..353d27e61b 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) Core: fix possible crash at startup in case of nonexistent DocumentRoot. + PR 39722 [Adrian Buckley ] + *) mod_proxy: add "nocanon" keyword to ProxyPass, to suppress URI-canonicalisation in a reverse proxy. PR 41798 [Nick Kew] diff --git a/server/core.c b/server/core.c index 84b58726fa..ab938d0469 100644 --- a/server/core.c +++ b/server/core.c @@ -1164,6 +1164,9 @@ static const char *set_document_root(cmd_parms *cmd, void *dummy, /* Make it absolute, relative to ServerRoot */ arg = ap_server_root_relative(cmd->pool, arg); + if (arg == NULL) { + return "DocumentRoot must be a directory"; + } /* TODO: ap_configtestonly && ap_docrootcheck && */ if (apr_filepath_merge((char**)&conf->ap_document_root, NULL, arg,