diff options
| author | Stanislav Malyshev <stas@php.net> | 2018-04-22 22:01:35 -0700 |
|---|---|---|
| committer | Stanislav Malyshev <stas@php.net> | 2018-04-22 22:01:35 -0700 |
| commit | 49782c54994ecca2ef2a061063bd5a7079c43527 (patch) | |
| tree | 7b87fc214ac28286936c95fab7dbaab199ddd222 /ext/ldap/ldap.c | |
| parent | cb981e39c29bda59897cfaf30cebbf534c27f47c (diff) | |
| download | php-git-49782c54994ecca2ef2a061063bd5a7079c43527.tar.gz | |
Fix bug #76248 - Malicious LDAP-Server Response causes Crash
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 8ab0fe0727..03ca03d3ad 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1103,7 +1103,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, 1); + if (dn) { + add_assoc_string(tmp1, "dn", dn, 1); + } else { + add_assoc_null(tmp1, "dn"); + } #if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP || WINDOWS ldap_memfree(dn); #else |
