From 5b8d0dc6ae01907d35ea51c061addedfe81e4e1f Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 18 Mar 2016 11:50:03 +0800 Subject: [PATCH] Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex --- ext/pdo/pdo_stmt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 6019c39aba..c86864a966 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1542,16 +1542,16 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, { struct pdo_bound_param_data param = {{{0}}}; zend_long param_type = PDO_PARAM_STR; - zval *parameter; + zval *parameter, *driver_params = NULL; param.paramno = -1; if (FAILURE == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "lz|llz!", ¶m.paramno, ¶meter, ¶m_type, ¶m.max_value_len, - ¶m.driver_params)) { + &driver_params)) { if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|llz!", ¶m.name, ¶meter, ¶m_type, ¶m.max_value_len, - ¶m.driver_params)) { + &driver_params)) { return 0; } } @@ -1565,6 +1565,10 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, return 0; } + if (driver_params) { + ZVAL_COPY(¶m.driver_params, driver_params); + } + ZVAL_COPY(¶m.parameter, parameter); if (!really_register_bound_param(¶m, stmt, is_param)) { if (!Z_ISUNDEF(param.parameter)) { -- 2.50.1