mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fix null byte in LDAP bindings
This commit is contained in:
parent
40a9316dff
commit
ad1b9eef98
2 changed files with 13 additions and 0 deletions
3
NEWS
3
NEWS
|
@ -37,6 +37,9 @@ PHP NEWS
|
||||||
. Fixed bug #66021 (Blank line inside empty array/object when
|
. Fixed bug #66021 (Blank line inside empty array/object when
|
||||||
JSON_PRETTY_PRINT is set). (Kevin Israel)
|
JSON_PRETTY_PRINT is set). (Kevin Israel)
|
||||||
|
|
||||||
|
- LDAP:
|
||||||
|
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
|
||||||
|
|
||||||
- SimpleXML:
|
- SimpleXML:
|
||||||
. Fixed bug #66084 (simplexml_load_string() mangles empty node name)
|
. Fixed bug #66084 (simplexml_load_string() mangles empty node name)
|
||||||
(Anatol)
|
(Anatol)
|
||||||
|
|
|
@ -399,6 +399,16 @@ PHP_FUNCTION(ldap_bind)
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
|
||||||
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
|
||||||
|
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
|
||||||
|
|
||||||
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
|
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue