andrey Mon Jul 11 10:14:57 2005 EDT
Modified files:
/php-src/ext/pdo pdo_stmt.c
Log:
fix a segfault with the following script:
<?php
$dbh = new PDO('mysql:dbname=test;host=localhost', "root", "secret");
$what = 1;
$stmt = $dbh->prepare('select a, b, c from t123 where a=:what');
$stmt->bindParam(1, $what, PDO_PARAM_INT, 12);
var_dump($stmt->execute());
var_dump($stmt->fetchObject());
?>
http://cvs.php.net/diff.php/php-src/ext/pdo/pdo_stmt.c?r1=1.108&r2=1.109&ty=u
Index: php-src/ext/pdo/pdo_stmt.c
diff -u php-src/ext/pdo/pdo_stmt.c:1.108 php-src/ext/pdo/pdo_stmt.c:1.109
--- php-src/ext/pdo/pdo_stmt.c:1.108 Fri Jul 8 23:52:39 2005
+++ php-src/ext/pdo/pdo_stmt.c Mon Jul 11 10:14:56 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdo_stmt.c,v 1.108 2005/07/09 03:52:39 wez Exp $ */
+/* $Id: pdo_stmt.c,v 1.109 2005/07/11 14:14:56 andrey Exp $ */
/* The PDO Statement Handle Class */
@@ -91,7 +91,10 @@
/* this is not an error here */
return 1;
}
-
+ if (!param->name) {
+ return 1;
+ }
+
zend_hash_internal_pointer_reset(stmt->bound_param_map);
while (SUCCESS ==
zend_hash_get_current_data(stmt->bound_param_map, (void**)&name)) {
if (strcmp(name, param->name)) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php