]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
port fix to ITS#3642 (dnssrv crasher)
authorPierangelo Masarati <ando@openldap.org>
Wed, 20 Apr 2005 14:14:15 +0000 (14:14 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 20 Apr 2005 14:14:15 +0000 (14:14 +0000)
CHANGES
servers/slapd/back-dnssrv/referral.c

diff --git a/CHANGES b/CHANGES
index 95097e77c6fa3acb4646f28dd3a3e55912fade79..400b470c11f1aa7bcac62cc56a6a4545e4633139 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,7 @@ OpenLDAP 2.2 Change Log
 
 OpenLDAP 2.2.25 Engineering
        Fixed back-bdb ctxcsn/LRU bug (ITS#3666)
+       Fixed back-dnssrv referral all but search op crasher bug (ITS#3642)
        Fixed back-meta memory leak (ITS#3669)
 
 OpenLDAP 2.2.24 Release
index 040d868f324aec057c04bdb5132e50365e7b9dfe..de25129af117ada5a14dc7f277f42bbdb055e82d 100644 (file)
@@ -59,16 +59,18 @@ dnssrv_back_referrals(
                rs->sr_err = LDAP_REFERRAL;
                rs->sr_ref = default_referral;
                send_ldap_result( op, rs );
+               rs->sr_ref = NULL;
                return LDAP_REFERRAL;
        }
 
        Debug( LDAP_DEBUG_TRACE, "DNSSRV: dn=\"%s\" -> domain=\"%s\"\n",
                op->o_req_dn.bv_val, domain, 0 );
 
-       if( ( rc = ldap_domain2hostlist( domain, &hostlist ) ) ) {
+       i = ldap_domain2hostlist( domain, &hostlist );
+       if ( i ) {
                Debug( LDAP_DEBUG_TRACE,
                        "DNSSRV: domain2hostlist(%s) returned %d\n",
-                       domain, rc, 0 );
+                       domain, i, 0 );
                rs->sr_text = "no DNS SRV RR available for DN";
                rc = LDAP_NO_SUCH_OBJECT;
                goto done;
@@ -109,6 +111,8 @@ dnssrv_back_referrals(
        rs->sr_ref = urls;
        send_ldap_error( op, rs, LDAP_REFERRAL,
                "DNS SRV generated referrals" );
+       rs->sr_ref = NULL;
+       rc = LDAP_REFERRAL;
 
 done:
        if( domain != NULL ) ch_free( domain );