You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2002/03/15 16:31:17 UTC
cvs commit: httpd-2.0/modules/mappers mod_so.c
wrowe 02/03/15 07:31:17
Modified: modules/mappers mod_so.c
Log:
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.
Revision Changes Path
1.47 +16 -0 httpd-2.0/modules/mappers/mod_so.c
Index: mod_so.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_so.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- mod_so.c 13 Mar 2002 20:47:50 -0000 1.46
+++ mod_so.c 15 Mar 2002 15:31:17 -0000 1.47
@@ -212,6 +212,14 @@
*/
*(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 @@
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];