]> git.sur5r.net Git - openldap/commitdiff
check pointers (ITS#4320)
authorPierangelo Masarati <ando@openldap.org>
Tue, 10 Jan 2006 01:53:29 +0000 (01:53 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 10 Jan 2006 01:53:29 +0000 (01:53 +0000)
servers/slapd/controls.c

index 280b4f14b0db6b47a1720cf9fc56539c807c42b7..0ed668bd8030354264ba345f2efb32c0ad8be5f5 100644 (file)
@@ -893,10 +893,16 @@ static int parseProxyAuthz (
                        op->o_connid, 0, 0 );
 
                /* anonymous */
-               op->o_ndn.bv_val[ 0 ] = '\0';
+               /* FIXME: do we let anonymous authz as anonymous?
+                * should we disallow authz at all for anonymous? */
+               if ( !BER_BVISNULL( &op->o_ndn ) ) {
+                       op->o_ndn.bv_val[ 0 ] = '\0';
+               }
                op->o_ndn.bv_len = 0;
 
-               op->o_dn.bv_val[ 0 ] = '\0';
+               if ( !BER_BVISNULL( &op->o_dn ) ) {
+                       op->o_dn.bv_val[ 0 ] = '\0';
+               }
                op->o_dn.bv_len = 0;
 
                return LDAP_SUCCESS;