]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Commit promoted backport of PR 45994.
authorPaul J. Reder <rederpj@apache.org>
Thu, 18 Dec 2008 17:31:03 +0000 (17:31 +0000)
committerPaul J. Reder <rederpj@apache.org>
Thu, 18 Dec 2008 17:31:03 +0000 (17:31 +0000)
  *) 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>]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@727773 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/ldap/util_ldap.c

diff --git a/CHANGES b/CHANGES
index 5420876a48cb8e8645aabc9badd777b3a7aea6fd..95584c19858d1f57c2b4e85f33df28d9f36282f8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.12
 
+  *) 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>]
+
   *) Set Listen protocol to "https" if port is set to 443 and no proto is specified
      (as documented but not implemented). PR 46066  [Dan Poirier <poirier pobox.com>]
 
diff --git a/STATUS b/STATUS
index 5d541fd3130c46f575ef622df00c40385c0ed622..c4b9349df5e3985e258cde4b4067dc7d53cb24ec 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -86,15 +86,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * 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>]
-   Trunk version of patch:
-      http://svn.apache.org/viewvc?view=rev&revision=727053
-   Backport version for 2.2.x of patch:
-      http://people.apache.org/~rederpj/backport_PR45994_util_ldap.c.diff
-   +1: rederpj, rpluem, covener
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 
index 5ea50d0a6c8bd68c5dce050c7e49218f066929d0..c9cc6e988a6d4e1fbdde3a613d9370cad6bbce9f 100644 (file)
@@ -232,7 +232,16 @@ static int uldap_connection_init(request_rec *r,
                   &(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;
     }