mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
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:
parent
9749926224
commit
b3aa24ff98
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user