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 gr...@apache.org on 2006/04/23 05:02:35 UTC

svn commit: r396208 - in /httpd/mod_python/trunk: lib/python/mod_python/__init__.py src/include/mpversion.h src/requestobject.c

Author: grahamd
Date: Sat Apr 22 20:02:33 2006
New Revision: 396208

URL: http://svn.apache.org/viewcvs?rev=396208&view=rev
Log:
Calling the req.auth_type() and req.auth_name() functions when the
directives hadn't been used to set the corresponding value would cause
Apache to crash due to a null pointer being used to construct a Python
string object. (MODPYTHON-124)

Modified:
    httpd/mod_python/trunk/lib/python/mod_python/__init__.py
    httpd/mod_python/trunk/src/include/mpversion.h
    httpd/mod_python/trunk/src/requestobject.c

Modified: httpd/mod_python/trunk/lib/python/mod_python/__init__.py
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/lib/python/mod_python/__init__.py?rev=396208&r1=396207&r2=396208&view=diff
==============================================================================
--- httpd/mod_python/trunk/lib/python/mod_python/__init__.py (original)
+++ httpd/mod_python/trunk/lib/python/mod_python/__init__.py Sat Apr 22 20:02:33 2006
@@ -20,5 +20,5 @@
 __all__ = ["apache", "cgihandler", "psp",
            "publisher", "util", "python22"]
 
-version = "3.3.0-dev-20060421"
+version = "3.3.0-dev-20060423"
 

Modified: httpd/mod_python/trunk/src/include/mpversion.h
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/include/mpversion.h?rev=396208&r1=396207&r2=396208&view=diff
==============================================================================
--- httpd/mod_python/trunk/src/include/mpversion.h (original)
+++ httpd/mod_python/trunk/src/include/mpversion.h Sat Apr 22 20:02:33 2006
@@ -1,5 +1,5 @@
 #define MPV_MAJOR 3
 #define MPV_MINOR 3
 #define MPV_PATCH 0
-#define MPV_BUILD 20060421
-#define MPV_STRING "3.3.0-dev-20060421"
+#define MPV_BUILD 20060423
+#define MPV_STRING "3.3.0-dev-20060423"

Modified: httpd/mod_python/trunk/src/requestobject.c
URL: http://svn.apache.org/viewcvs/httpd/mod_python/trunk/src/requestobject.c?rev=396208&r1=396207&r2=396208&view=diff
==============================================================================
--- httpd/mod_python/trunk/src/requestobject.c (original)
+++ httpd/mod_python/trunk/src/requestobject.c Sat Apr 22 20:02:33 2006
@@ -477,7 +477,13 @@
 
 static PyObject *req_auth_name(requestobject *self)
 {
-    return PyString_FromString(ap_auth_name(self->request_rec));
+    const char *auth_name = ap_auth_name(self->request_rec);
+
+    if (!auth_name) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+    return PyString_FromString(auth_name);
 }
 
 /**
@@ -488,7 +494,14 @@
 
 static PyObject *req_auth_type(requestobject *self)
 {
-    return PyString_FromString(ap_auth_type(self->request_rec));
+    const char *auth_type = ap_auth_type(self->request_rec);
+
+    if (!auth_type) {
+        Py_INCREF(Py_None);
+        return Py_None;
+    }
+
+    return PyString_FromString(auth_type);
 }
 
 /**