Skip to content

Commit 5e2186e

Browse files
committed
Merge branch 'PHP-7.0'
* PHP-7.0: Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex
2 parents 48e3459 + 5b8d0dc commit 5e2186e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,16 +1541,16 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
15411541
{
15421542
struct pdo_bound_param_data param = {{{0}}};
15431543
zend_long param_type = PDO_PARAM_STR;
1544-
zval *parameter;
1544+
zval *parameter, *driver_params = NULL;
15451545

15461546
param.paramno = -1;
15471547

15481548
if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(),
15491549
"lz|llz!", &param.paramno, &parameter, &param_type, &param.max_value_len,
1550-
&param.driver_params)) {
1550+
&driver_params)) {
15511551
if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", &param.name,
15521552
&parameter, &param_type, &param.max_value_len,
1553-
&param.driver_params)) {
1553+
&driver_params)) {
15541554
return 0;
15551555
}
15561556
}
@@ -1564,6 +1564,10 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
15641564
return 0;
15651565
}
15661566

1567+
if (driver_params) {
1568+
ZVAL_COPY(&param.driver_params, driver_params);
1569+
}
1570+
15671571
ZVAL_COPY(&param.parameter, parameter);
15681572
if (!really_register_bound_param(&param, stmt, is_param)) {
15691573
if (!Z_ISUNDEF(param.parameter)) {

0 commit comments

Comments
 (0)