You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by Justin Erenkrantz <je...@apache.org> on 2002/09/13 07:18:51 UTC
[PATCH] Segfault when serving virtual content
If mod_python is installed and virtual content is served (say
Subversion or mod_status), a segfault occurs since ext is undefined.
This should resolve the segfault. -- justin
Index: src/mod_python.c
===================================================================
RCS file: /home/cvs/httpd-python/src/mod_python.c,v
retrieving revision 1.74
diff -u -r1.74 mod_python.c
--- src/mod_python.c 12 Sep 2002 18:24:06 -0000 1.74
+++ src/mod_python.c 13 Sep 2002 05:10:59 -0000
@@ -806,7 +806,7 @@
py_config * conf;
int result;
const char *interp_name = NULL;
- const char *ext;
+ const char *ext = NULL;
hl_entry *hle = NULL;
hl_entry *dynhle = NULL;
@@ -825,11 +825,13 @@
/* is there an hlist entry, i.e. a handler? */
/* try with extension */
- hle = (hl_entry *)apr_hash_get(conf->hlists,
- apr_pstrcat(req->pool, phase, ext, NULL),
- APR_HASH_KEY_STRING);
+ if (ext) {
+ hle = (hl_entry *)apr_hash_get(conf->hlists,
+ apr_pstrcat(req->pool, phase, ext, NULL),
+ APR_HASH_KEY_STRING);
+ }
+ /* try without extension if we don't match */
if (!hle) {
- /* try without extension */
hle = (hl_entry *)apr_hash_get(conf->hlists, phase, APR_HASH_KEY_STRING);
}