]> granicus.if.org Git - apache/commitdiff
A coworker discovered that really bogus path names segfault the server
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 15 Mar 2002 15:31:17 +0000 (15:31 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 15 Mar 2002 15:31:17 +0000 (15:31 +0000)
  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

modules/mappers/mod_so.c

index 6e83e3a0e88ae8cc53f60af5f1eae714f36aa77b..ca9faac2426ededa93210d11e7af1a36e7c76601 100644 (file)
@@ -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];