mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
This commit is contained in:
@@ -4041,6 +4041,11 @@ static void php_ldap_exop(INTERNAL_FUNCTION_PARAMETERS, bool force_sync) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (ZSTR_LEN(reqoid) == 0) {
|
||||
zend_argument_must_not_be_empty_error(2);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
ld = Z_LDAP_LINK_P(link);
|
||||
VERIFY_LDAP_LINK_CONNECTED(ld);
|
||||
|
||||
|
||||
30
ext/ldap/tests/gh18902.phpt
Normal file
30
ext/ldap/tests/gh18902.phpt
Normal file
@@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
GH-17704 (ldap_search fails when $attributes contains a non-packed array with numerical keys)
|
||||
--EXTENSIONS--
|
||||
ldap
|
||||
--FILE--
|
||||
<?php
|
||||
$conn = ldap_connect();
|
||||
|
||||
try {
|
||||
ldap_exop($conn,"\0");
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
ldap_exop_sync($conn,"");
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
|
||||
try {
|
||||
ldap_exop_sync($conn,"test\0");
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage(), PHP_EOL;
|
||||
}
|
||||
?>
|
||||
--EXPECTF--
|
||||
ldap_exop(): Argument #2 ($request_oid) must not contain any null bytes
|
||||
ldap_exop_sync(): Argument #2 ($request_oid) must not be empty
|
||||
ldap_exop_sync(): Argument #2 ($request_oid) must not contain any null bytes
|
||||
Reference in New Issue
Block a user