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());
?>
This commit is contained in:
Andrey Hristov 2005-07-11 14:14:56 +00:00
parent 9749926224
commit b3aa24ff98

View File

@ -91,7 +91,10 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
/* 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)) {