diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-11 16:35:03 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-12-11 16:35:03 +0100 |
commit | ccb7f1c7d8518dc4548273a5acd578c57d47cc0c (patch) | |
tree | a1397038e119cefbd4ee7d3358f4e0b76b892edb /ext/pdo_mysql/mysql_statement.c | |
parent | 7a89157f8c440bccdd0317c1f460d2a916c5896c (diff) | |
download | php-git-ccb7f1c7d8518dc4548273a5acd578c57d47cc0c.tar.gz |
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.
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rw-r--r-- | ext/pdo_mysql/mysql_statement.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 7d75be2adc..871b7f9c7c 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -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"); |