diff options
Diffstat (limited to 'ext/ldap/ldap.c')
-rw-r--r-- | ext/ldap/ldap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 0ba62d9bc9..3839f871a9 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1242,7 +1242,11 @@ PHP_FUNCTION(ldap_get_entries) add_assoc_long(&tmp1, "count", num_attrib); dn = ldap_get_dn(ldap, ldap_result_entry); - add_assoc_string(&tmp1, "dn", dn); + if (dn) { + add_assoc_string(&tmp1, "dn", dn); + } else { + add_assoc_null(&tmp1, "dn"); + } #if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(dn); #else |