Commit 6191e3a
committed
ext/mysqlnd: Fix persistent free of non-persistent connect_attr key.
set_client_option_2d() built the temporary key string with the
connection's persistent flag but always released it with persistent=1.
On a duplicate-key update of the connect_attr hash, zend_hash_update()
does not retain the passed key, so the caller-owned non-persistent
string was freed via free() instead of efree(), tripping the
IS_STR_PERSISTENT assertion in debug builds and mismatching allocators
in release. Reachable by retrying mysqli_real_connect() on a handle
whose first connect failed, since mysqlnd re-adds _client_name and
_server_host on every connect attempt.1 parent 5bd7e3b commit 6191e3a
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1572 | 1572 | | |
1573 | 1573 | | |
1574 | 1574 | | |
| 1575 | + | |
1575 | 1576 | | |
1576 | | - | |
1577 | 1577 | | |
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
1581 | | - | |
1582 | 1581 | | |
1583 | 1582 | | |
1584 | 1583 | | |
1585 | | - | |
| 1584 | + | |
1586 | 1585 | | |
1587 | 1586 | | |
1588 | 1587 | | |
| |||
0 commit comments