]> git.sur5r.net Git - openldap/commitdiff
cure ITS#3602
authorPierangelo Masarati <ando@openldap.org>
Tue, 15 Mar 2005 23:01:06 +0000 (23:01 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 15 Mar 2005 23:01:06 +0000 (23:01 +0000)
servers/slapd/back-bdb/referral.c

index c52288bc2615fdb4a545bca6cc5b6af430bfbc22..c79aee60577fc15a5baeeea085567ad6b7a73375 100644 (file)
@@ -53,7 +53,13 @@ dn2entry_retry:
        /* get entry */
        rc = bdb_dn2entry( op, NULL, &op->o_req_ndn, &ei, 1, locker, &lock );
 
-       e = ei->bei_e;
+       /* bdb_dn2entry() may legally leave ei == NULL
+        * if rc != 0 and rc != DB_NOTFOUND
+        */
+       if ( ei ) {
+               e = ei->bei_e;
+       }
+
        switch(rc) {
        case DB_NOTFOUND:
        case 0: