Skip to content

Commit cb009b1

Browse files
committed
Fixed bug #77273
1 parent 73596c5 commit cb009b1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ PHP NEWS
99
. Fixed bug #75684 (In mysqlnd_ext_plugin.h the plugin methods family has
1010
no external visibility). (Anatol)
1111

12+
- PDO:
13+
. Fixed bug #77273 (array_walk_recursive corrupts value types leading to PDO
14+
failure). (Nikita)
15+
1216
- Sockets:
1317
. Fixed bug #76839 (socket_recvfrom may return an invalid 'from' address
1418
on MacOS). (Michael Meyer)

ext/pdo/pdo_dbh.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static PHP_METHOD(PDO, dbh_constructor)
273273
pdo_dbh_t *pdbh = NULL;
274274
zval *v;
275275

276-
if ((v = zend_hash_index_find(Z_ARRVAL_P(options), PDO_ATTR_PERSISTENT)) != NULL) {
276+
if ((v = zend_hash_index_find_deref(Z_ARRVAL_P(options), PDO_ATTR_PERSISTENT)) != NULL) {
277277
if (Z_TYPE_P(v) == IS_STRING &&
278278
!is_numeric_string(Z_STRVAL_P(v), Z_STRLEN_P(v), NULL, NULL, 0) && Z_STRLEN_P(v) > 0) {
279279
/* user specified key */
@@ -386,6 +386,7 @@ static PHP_METHOD(PDO, dbh_constructor)
386386
if (str_key) {
387387
continue;
388388
}
389+
ZVAL_DEREF(attr_value);
389390
pdo_dbh_attribute_set(dbh, long_key, attr_value);
390391
} ZEND_HASH_FOREACH_END();
391392
}

0 commit comments

Comments
 (0)