From 22edaef4f86f85b14eb31384fc617e4d8860da2d Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Wed, 11 Dec 2013 04:41:48 -0800
Subject: [PATCH] ITS#7762 shortcut NULL RDNs

---
 libraries/libldap/getdn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c
index c69882e89f..5bfb223239 100644
--- a/libraries/libldap/getdn.c
+++ b/libraries/libldap/getdn.c
@@ -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 );
 	}
-- 
GitLab