Adjusted fix for bug #42978

This commit is contained in:
Ilia Alshanetsky 2007-11-20 23:12:17 +00:00
parent cbf466a953
commit 204f9e1a74
2 changed files with 5 additions and 5 deletions

View File

@ -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**)&param)) {
if (!stmt->methods->param_hook(stmt, param, event_type TSRMLS_CC)) {

View File

@ -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;