Skip to content

Commit

Permalink
Fixed bug #77273
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 3, 2019
1 parent 73596c5 commit cb009b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ PHP NEWS
. Fixed bug #75684 (In mysqlnd_ext_plugin.h the plugin methods family has
no external visibility). (Anatol)

- PDO:
. Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO
failure). (Nikita)

- Sockets:
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
on MacOS). (Michael Meyer)
Expand Down
3 changes: 2 additions & 1 deletion ext/pdo/pdo_dbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static PHP_METHOD(PDO, dbh_constructor)
pdo_dbh_t *pdbh = NULL;
zval *v;

if ((v = zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_PERSISTENT)) != NULL) {
if ((v = zend_hash_index_find_deref(Z_ARRVAL_P(options), PDO_ATTR_PERSISTENT)) != NULL) {
if (Z_TYPE_P(v) == IS_STRING &&
!is_numeric_string(Z_STRVAL_P(v), Z_STRLEN_P(v), NULL, NULL, 0) && Z_STRLEN_P(v) > 0) {
/* user specified key */
Expand Down Expand Up @@ -386,6 +386,7 @@ static PHP_METHOD(PDO, dbh_constructor)
if (str_key) {
continue;
}
ZVAL_DEREF(attr_value);
pdo_dbh_attribute_set(dbh, long_key, attr_value);
} ZEND_HASH_FOREACH_END();
}
Expand Down

0 comments on commit cb009b1

Please sign in to comment.