From: William A. Rowe Jr Date: Fri, 15 Mar 2002 15:31:17 +0000 (+0000) Subject: A coworker discovered that really bogus path names segfault the server X-Git-Tag: CHANGES~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e8d8b0bdd7c8c9ca7c6d4d3dee4abb86d8a16c2;p=apache A coworker discovered that really bogus path names segfault the server on Win32. ap_server_root_relative() doesn't have an apr_status_t result, so we are limited in what we can figure out - but 99.99% of the time, the file's path is just plain bogus. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93956 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_so.c b/modules/mappers/mod_so.c index 6e83e3a0e8..ca9faac242 100644 --- a/modules/mappers/mod_so.c +++ b/modules/mappers/mod_so.c @@ -212,6 +212,14 @@ static const char *load_module(cmd_parms *cmd, void *dummy, */ *(ap_directive_t **)dummy = NULL; + /* ap_server_root_relative returns NULL if the paths couldn't be + * merged (one is corrupt - dollars to donuts it's the named module + */ + if (!szModuleFile) { + return apr_pstrcat(cmd->pool, "Cannot parse module name ", + filename, NULL); + } + /* * check for already existing module * If it already exists, we have nothing to do @@ -304,6 +312,14 @@ static const char *load_file(cmd_parms *cmd, void *dummy, const char *filename) file = ap_server_root_relative(cmd->pool, filename); + /* ap_server_root_relative returns NULL if the paths couldn't be + * merged (one is corrupt - dollars to donuts it's the named module + */ + if (!file) { + return apr_pstrcat(cmd->pool, "Cannot parse file name ", + filename, NULL); + } + if (apr_dso_load(&handle, file, cmd->pool) != APR_SUCCESS) { char my_error[256];