cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c
| From: | Ilia Alshanetsky | Date: | Tue, 20 Nov 2007 14:22:27 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/pdo pdo_stmt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-47241@lists.php.net to get a copy of this message | ||
iliaa Tue Nov 20 14:22:27 2007 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/pdo pdo_stmt.c
Log:
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.24.2.5&r2=1.118.2.38.2.24.2.6&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.24.2.5
php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.6
--- php-src/ext/pdo/pdo_stmt.c:1.118.2.38.2.24.2.5 Wed Oct 31 12:57:51 2007
+++ php-src/ext/pdo/pdo_stmt.c Tue Nov 20 14:22:27 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.5 2007/10/31 12:57:51 iliaa Exp $ */
+/* $Id: pdo_stmt.c,v 1.118.2.38.2.24.2.6 2007/11/20 14:22:27 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)) {