iliaa Tue Nov 20 14:22:40 2007 UTC Modified files: /php-src/ext/pdo pdo_stmt.c Log: MFB: Fixed bug #42978 (mismatch between number of bound params and values causes a crash in pdo_pgsql) http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_stmt.c?r1=1.180&r2=1.181&diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.180 php-src/ext/pdo/pdo_stmt.c:1.181 --- php-src/ext/pdo/pdo_stmt.c:1.180 Wed Oct 31 12:58:39 2007 +++ php-src/ext/pdo/pdo_stmt.c Tue Nov 20 14:22:40 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_stmt.c,v 1.180 2007/10/31 12:58:39 iliaa Exp $ */ +/* $Id: pdo_stmt.c,v 1.181 2007/11/20 14:22:40 iliaa Exp $ */ /* The PDO Statement Handle Class */ @@ -144,6 +144,11 @@ 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)) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php