com php-src: Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex: ext/pdo/pdo_stm t.c
| From: | Xinchen Hui | Date: | Fri, 18 Mar 2016 03:50:03 +0000 |
| Subject: | com php-src: Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex: ext/pdo/pdo_stm t.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91410@lists.php.net to get a copy of this message | ||
Commit: 5b8d0dc6ae01907d35ea51c061addedfe81e4e1f
Author: Xinchen Hui <laruence@gmail.com> Fri, 18 Mar 2016 11:50:03 +0800
Parents: 945a661912612cdecd221cd126feda7d4335c33c
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5b8d0dc6ae01907d35ea51c061addedfe81e4e1f
Log:
Fixed pdo_stmt.c: zval* being passed into zend_parse_parameters_ex
Changed paths:
M ext/pdo/pdo_stmt.c
Diff:
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 6019c39..c86864a 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)) {