mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02: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
1 changed files with 4 additions and 1 deletions
|
@ -91,6 +91,9 @@ static inline int rewrite_name_to_position(pdo_stmt_t *stmt, struct pdo_bound_pa
|
||||||
/* this is not an error here */
|
/* this is not an error here */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (!param->name) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
zend_hash_internal_pointer_reset(stmt->bound_param_map);
|
zend_hash_internal_pointer_reset(stmt->bound_param_map);
|
||||||
while (SUCCESS == zend_hash_get_current_data(stmt->bound_param_map, (void**)&name)) {
|
while (SUCCESS == zend_hash_get_current_data(stmt->bound_param_map, (void**)&name)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue