iliaa Tue Nov 20 14:23:47 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pdo pdo_stmt.c /php-src NEWS 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.118.2.38.2.26&r2=1.118.2.38.2.27&diff_format=u Index: php-src/ext/pdo/pdo_stmt.c diff -u php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.26 php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.27 --- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.26 Wed Oct 31 12:58:24 2007 +++ php-src/ext/pdo/pdo_stmt.c Tue Nov 20 14:23:46 2007 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_stmt.c,v 1.118.2.38.2.26 2007/10/31 12:58:24 iliaa Exp $ */ +/* $Id: pdo_stmt.c,v 1.118.2.38.2.27 2007/11/20 14:23:46 iliaa Exp $ */ /* The PDO Statement Handle Class */ @@ -168,6 +168,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)) { http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1015&r2=1.2027.2.547.2.1016&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1015 php-src/NEWS:1.2027.2.547.2.1016 --- php-src/NEWS:1.2027.2.547.2.1015 Sun Nov 18 14:20:17 2007 +++ php-src/NEWS Tue Nov 20 14:23:47 2007 @@ -18,6 +18,8 @@ truncation). (Ilia) - Fixed bug #43175 (__destruct() throwing an exception with __call() causes segfault). (Dmitry) +- Fixed bug #42978 (mismatch between number of bound params and values causes + a crash in pdo_pgsql). (Ilia) - Fixed bug #42937 (__call() method not invoked when methods are called on parent from child class). (Dmitry) - Fixed bug #42736 (xmlrpc_server_call_method() crashes). (Tony)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php