Skip to content

Commit fafce65

Browse files
committed
Merge branch 'PHP-7.1'
* PHP-7.1: Update NEWS Fixed bug #73933 (error/segfault with ldap_mod_replace and opcache)
2 parents cbc416e + abe094d commit fafce65

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ext/ldap/ldap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
14701470
zend_ulong index;
14711471
int is_full_add=0; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */
14721472

1473-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &link, &dn, &dn_len, &entry) != SUCCESS) {
1473+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &link, &dn, &dn_len, &entry) != SUCCESS) {
14741474
return;
14751475
}
14761476

@@ -1518,6 +1518,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
15181518
if (Z_TYPE_P(value) != IS_ARRAY) {
15191519
num_values = 1;
15201520
} else {
1521+
SEPARATE_ARRAY(value);
15211522
num_values = zend_hash_num_elements(Z_ARRVAL_P(value));
15221523
}
15231524

ext/ldap/tests/bug73933.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #73933 (error/segfault with ldap_mod_replace and opcache)
3+
--SKIPIF--
4+
<?php
5+
require_once('skipif.inc');
6+
?>
7+
--FILE--
8+
<?php
9+
/* We are assuming 3333 is not connectable */
10+
$ldap = ldap_connect('127.0.0.1', 3333);
11+
12+
ldap_mod_replace($ldap, null, array(
13+
'lockoutTime' => array(0),
14+
));
15+
16+
ldap_close($ldap);
17+
18+
?>
19+
--EXPECTF--
20+
Warning: ldap_mod_replace(): Modify: Can't contact LDAP server in %sbug73933.php on line %d

0 commit comments

Comments
 (0)