httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rede...@apache.org
Subject svn commit: r727053 - in /httpd/httpd/trunk: CHANGES modules/ldap/util_ldap.c
Date Tue, 16 Dec 2008 14:08:19 GMT
Author: rederpj
Date: Tue Dec 16 06:08:19 2008
New Revision: 727053

URL: http://svn.apache.org/viewvc?rev=727053&view=rev
Log:
*) mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init
   when result is NULL. This could happen if LDAP initialization failed.
   PR 45994.  [Dan Poirier <poirier pobox.com>]

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/ldap/util_ldap.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=727053&r1=727052&r2=727053&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Tue Dec 16 06:08:19 2008
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.1
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_ldap: Avoid a segfault when result->rc is checked in uldap_connection_init
+     when result is NULL. This could happen if LDAP initialization failed.
+     PR 45994.  [Dan Poirier <poirier pobox.com>]
+
   *) mod_cache: Correctly save Content-Encoding of cachable entity. PR 46401
      [Dan Poirier <poirier pobox.com>]
 

Modified: httpd/httpd/trunk/modules/ldap/util_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap.c?rev=727053&r1=727052&r2=727053&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap.c Tue Dec 16 06:08:19 2008
@@ -292,7 +292,16 @@
                   APR_LDAP_NONE,
                   &(result));
 
-    if (result != NULL && result->rc) {
+    if (NULL == result) {
+        /* something really bad happened */
+        ldc->bound = 0;
+        if (NULL == ldc->reason) {
+            ldc->reason = "LDAP: ldap initialization failed";
+        }
+        return(APR_EGENERAL);
+    }
+
+    if (result->rc) {
         ldc->reason = result->reason;
     }
 



Mime
View raw message