File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -2714,11 +2714,11 @@ PHP_FUNCTION(ldap_modify_batch)
27142714 ZEND_HASH_FOREACH_NUM_KEY_VAL (modifications , modification_index , modification_zv ) {
27152715 ldap_mods [modification_index ] = safe_emalloc (1 , sizeof (LDAPMod ), 0 );
27162716
2717- zval * attrib_zv = zend_hash_str_find (Z_ARRVAL_P (modification_zv ), LDAP_MODIFY_BATCH_ATTRIB , strlen (LDAP_MODIFY_BATCH_ATTRIB ));
2717+ zval * attrib_zv = zend_hash_str_find_deref (Z_ARRVAL_P (modification_zv ), LDAP_MODIFY_BATCH_ATTRIB , strlen (LDAP_MODIFY_BATCH_ATTRIB ));
27182718 ZEND_ASSERT (Z_TYPE_P (attrib_zv ) == IS_STRING );
2719- zval * modtype_zv = zend_hash_str_find (Z_ARRVAL_P (modification_zv ), LDAP_MODIFY_BATCH_MODTYPE , strlen (LDAP_MODIFY_BATCH_MODTYPE ));
2719+ zval * modtype_zv = zend_hash_str_find_deref (Z_ARRVAL_P (modification_zv ), LDAP_MODIFY_BATCH_MODTYPE , strlen (LDAP_MODIFY_BATCH_MODTYPE ));
27202720 ZEND_ASSERT (Z_TYPE_P (modtype_zv ) == IS_LONG );
2721- zval * modification_values = zend_hash_str_find (Z_ARRVAL_P (modification_zv ), LDAP_MODIFY_BATCH_VALUES , strlen (LDAP_MODIFY_BATCH_VALUES ));
2721+ zval * modification_values = zend_hash_str_find_deref (Z_ARRVAL_P (modification_zv ), LDAP_MODIFY_BATCH_VALUES , strlen (LDAP_MODIFY_BATCH_VALUES ));
27222722 ZEND_ASSERT (modification_values == NULL || Z_TYPE_P (modification_values ) == IS_ARRAY );
27232723
27242724 /* map the modification type */
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-16389 (Assertion failure in ext/ldap/ldap.c:2718)
3+ --EXTENSIONS--
4+ ldap
5+ --FILE--
6+ <?php
7+ $ attrib = "attrib " ;
8+ $ modtype = LDAP_MODIFY_BATCH_ADD ;
9+ $ values = ["value1 " ];
10+ $ ldap = ldap_connect ('ldap://127.0.0.1:3333 ' );
11+ $ modification_attrib_reference_string = [
12+ [
13+ "attrib " => &$ attrib ,
14+ "modtype " => &$ modtype ,
15+ "values " => &$ values ,
16+ ],
17+ ];
18+ var_dump (ldap_modify_batch ($ ldap , "" , $ modification_attrib_reference_string ));
19+ ?>
20+ --EXPECTF--
21+ Warning: ldap_modify_batch(): Batch Modify: Can't contact LDAP server in %s on line %d
22+ bool(false)
You can’t perform that action at this time.
0 commit comments