diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2007-11-20 14:23:47 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2007-11-20 14:23:47 +0000 |
| commit | a4bc590ec1a4a86599e413d1d4d93fff0671d578 (patch) | |
| tree | 94bd001d69bdae0769124a0884be1b88fba1c02d /ext/pdo | |
| parent | c39a2f7143c6d73e3fd7e9d5203cdfe2e69c8c4f (diff) | |
| download | php-git-a4bc590ec1a4a86599e413d1d4d93fff0671d578.tar.gz | |
MFB: Fixed bug #42978 (mismatch between number of bound params and values
causes a crash in pdo_pgsql)
Diffstat (limited to 'ext/pdo')
| -rwxr-xr-x | ext/pdo/pdo_stmt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 2cc2428755..b1860ee243 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -168,6 +168,11 @@ 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)) { |
