mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #79132
Following cmb's suggestion and replacing the counter with a check against the bound_params HT, which ensures that both cannot go out of sync.
This commit is contained in:
parent
7a89157f8c
commit
ccb7f1c7d8
5 changed files with 69 additions and 4 deletions
|
@ -387,7 +387,6 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
|
|||
strcpy(stmt->error_code, "HY093");
|
||||
PDO_DBG_RETURN(0);
|
||||
}
|
||||
S->params_given++;
|
||||
|
||||
#ifndef PDO_USE_MYSQLND
|
||||
b = &S->params[param->paramno];
|
||||
|
@ -399,7 +398,7 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
|
|||
PDO_DBG_RETURN(1);
|
||||
|
||||
case PDO_PARAM_EVT_EXEC_PRE:
|
||||
if (S->params_given < (unsigned int) S->num_params) {
|
||||
if (zend_hash_num_elements(stmt->bound_params) < (unsigned int) S->num_params) {
|
||||
/* too few parameter bound */
|
||||
PDO_DBG_ERR("too few parameters bound");
|
||||
strcpy(stmt->error_code, "HY093");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue