You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-commits@quetz.apache.org by jg...@apache.org on 2006/01/11 00:36:39 UTC

svn commit: r367835 - /httpd/mod_python/trunk/src/mod_python.c

Author: jgallacher
Date: Tue Jan 10 15:36:37 2006
New Revision: 367835

URL: http://svn.apache.org/viewcvs?rev=367835&view=rev
Log:
Fix segfault when adding handler to empty list in python_handler.
Ref MODPYTHON-98

Modified:
    httpd/mod_python/trunk/src/mod_python.c

Modified: httpd/mod_python/trunk/src/mod_python.c
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/mod_python.c?rev=367835&r1=367834&r2=367835&view=diff
==============================================================================
--- httpd/mod_python/trunk/src/mod_python.c (original)
+++ httpd/mod_python/trunk/src/mod_python.c Tue Jan 10 15:36:37 2006
@@ -1092,12 +1092,18 @@
     if (ext) 
         request_obj->extension = apr_pstrdup(req->pool, ext);
 
-    /* create a hahdler list object */
-    request_obj->hlo = (hlistobject *)MpHList_FromHLEntry(hle);
+    if (!hle) {
+        /* create a handler list object from dynamically registered handlers */
+        request_obj->hlo = (hlistobject *)MpHList_FromHLEntry(dynhle);
+    }
+    else {
+        /* create a handler list object */
+        request_obj->hlo = (hlistobject *)MpHList_FromHLEntry(hle);
 
-    /* add dynamically registered handlers, if any */
-    if (dynhle) {
-        MpHList_Append(request_obj->hlo, dynhle);
+        /* add dynamically registered handlers, if any */
+        if (dynhle) {
+            MpHList_Append(request_obj->hlo, dynhle);
+        }
     }
 
     /*