]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/getdn.c
ITS#8167 Fix non-blocking TLS with referrals
[openldap] / libraries / libldap / getdn.c
index c69882e89f52b7b590d1b0c9f210e21f4468e7a9..0faaa1c067d515a40dcdf82a1997802bd8f6f8ed 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2013 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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 );
        }