[mod_python] inspect.getmembers(req) segfaults

Martin Devera devik at cdi.cz
Fri Dec 9 13:57:30 EST 2005


> I found other coredump, more on it later :)

Ok I attached cumulative fix for 3 similar bugs. By the way
I found no information who is the original author and how
to for example get SVN write access (If I'd like to fix
more bugs on the way).

regards, Martin
-------------- next part --------------
--- src/requestobject.c.old	Fri Dec  9 16:36:46 2005
+++ src/requestobject.c	Fri Dec  9 18:50:42 2005
@@ -1296,7 +1296,7 @@ static PyObject *getreq_rec_ah(requestob
 {
     const PyMemberDef *md = find_memberdef(request_rec_mbrs, name);
     apr_array_header_t *ah = 
-        (apr_array_header_t *)((char *)self->request_rec + md->offset);
+        *(apr_array_header_t **)((char *)self->request_rec + md->offset);
 
     return tuple_from_array_header(ah);
 }
@@ -1311,7 +1311,7 @@ static PyObject *getreq_rec_ml(requestob
 {
     const PyMemberDef *md = find_memberdef(request_rec_mbrs, (char*)name);
     ap_method_list_t *ml = 
-        (ap_method_list_t *)((char *)self->request_rec + md->offset);
+        *(ap_method_list_t **)((char *)self->request_rec + md->offset);
 
     return tuple_from_method_list(ml);
 }
--- src/serverobject.c.old	Fri Dec  9 19:20:43 2005
+++ src/serverobject.c	Fri Dec  9 19:20:49 2005
@@ -206,7 +206,7 @@ static PyObject *getsrv_recmbr_ah(server
 {
     const PyMemberDef *md = find_memberdef(server_rec_mbrs, name);
     apr_array_header_t *ah = 
-        (apr_array_header_t *)((char *)self->server + md->offset);
+        *(apr_array_header_t **)((char *)self->server + md->offset);
 
     return tuple_from_array_header(ah);
 }


More information about the Mod_python mailing list