Skip to content

Commit 4871865

Browse files
committed
Fixed GH-18902: ldap_exop/ldap_exop_sync assert triggered on empty request OID
1 parent a36b8fd commit 4871865

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/ldap/ldap.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,12 @@ static void php_ldap_exop(INTERNAL_FUNCTION_PARAMETERS, bool force_sync) {
40364036
LDAPControl **lserverctrls = NULL;
40374037
int rc, msgid;
40384038

4039-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS|S!a!zz", &link, ldap_link_ce, &reqoid, &reqdata, &serverctrls, &retdata, &retoid) != SUCCESS) {
4039+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "OP|S!a!zz", &link, ldap_link_ce, &reqoid, &reqdata, &serverctrls, &retdata, &retoid) != SUCCESS) {
4040+
RETURN_THROWS();
4041+
}
4042+
4043+
if (ZSTR_LEN(reqoid) == 0) {
4044+
zend_argument_value_error(2, "cannot be empty");
40404045
RETURN_THROWS();
40414046
}
40424047

0 commit comments

Comments
 (0)