mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
Adjusted fix for bug #42978
This commit is contained in:
parent
cbf466a953
commit
204f9e1a74
@ -168,11 +168,6 @@ static int dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_typ
|
||||
|
||||
iterate:
|
||||
if (ht) {
|
||||
if (zend_hash_num_elements(stmt->bound_param_map) != zend_hash_num_elements(ht)) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of bound paramters %d does not match number of bound values %d", zend_hash_num_elements(stmt->bound_param_map), zend_hash_num_elements(ht));
|
||||
return 0;
|
||||
}
|
||||
|
||||
zend_hash_internal_pointer_reset(ht);
|
||||
while (SUCCESS == zend_hash_get_current_data(ht, (void**)¶m)) {
|
||||
if (!stmt->methods->param_hook(stmt, param, event_type TSRMLS_CC)) {
|
||||
|
@ -265,6 +265,11 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
|
||||
sizeof(Oid));
|
||||
}
|
||||
if (param->paramno >= 0) {
|
||||
if (param->paramno > zend_hash_num_elements(stmt->bound_param_map)) {
|
||||
pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY105");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_LOB &&
|
||||
Z_TYPE_P(param->parameter) == IS_RESOURCE) {
|
||||
php_stream *stm;
|
||||
|
Loading…
Reference in New Issue
Block a user