]> git.sur5r.net Git - openldap/commitdiff
ITS#7762 shortcut NULL RDNs
authorHoward Chu <hyc@openldap.org>
Wed, 11 Dec 2013 12:41:48 +0000 (04:41 -0800)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 7 Jan 2014 23:53:32 +0000 (17:53 -0600)
libraries/libldap/getdn.c

index c69882e89f52b7b590d1b0c9f210e21f4468e7a9..5bfb223239203aacee5829dc1d0907057e939350 100644 (file)
@@ -2987,7 +2987,7 @@ int ldap_dn2bv_x( LDAPDN dn, struct berval *bv, unsigned flags, void *ctx )
         * a null dn means an empty dn string 
         * FIXME: better raise an error?
         */
-       if ( dn == NULL ) {
+       if ( dn == NULL || dn[0] == NULL ) {
                bv->bv_val = LDAP_STRDUPX( "", ctx );
                return( LDAP_SUCCESS );
        }