# PR #1723 - fix for crash in mysqli_connect

- Thread: https://externals.io/message/90600
- Original archive: https://news-web.php.net/php.internals/90600
- Started by John Bafford on 2016-01-13T13:37:21+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #90600 — John Bafford — 2016-01-13T13:37:21+00:00

URL: https://externals.io/message/90600#90600

Hi all,

Can someone take a look at this PR to fix a crash with mysqli_connect arising with a mysqlnd refactor in e81ecc80c in master from November:

https://github.com/php/php-src/pull/1723

When attempting to mysqlI_connect(‘localhost’, ‘user’, ‘pass), the mysqlnd_conn_data::get_scheme introduced in e81ecc80c was no longer able to update the socket_or_pipe in mysqlnd_conn_data::connect  with the socket filename in the event hostname == localhost. This causes a crash in mysqlnd_conn_data::connect when an attempt is made to duplicate the string to store it in conn->unix_socket.s.

Thanks!

-John

---

## #90601 — Andrey Hristov — 2016-01-13T13:46:39+00:00

URL: https://externals.io/message/90600#90601 · In reply to: #90600

Hi,
the patch looks ok. Sorry that I borked this.

Will push it in a short!

Thanks,
Andrey


> Hi all,
>
> Can someone take a look at this PR to fix a crash with mysqli_connect arising with a mysqlnd refactor in e81ecc80c in master from November:
>
> https://github.com/php/php-src/pull/1723
>
> When attempting to mysqlI_connect(‘localhost’, ‘user’, ‘pass), the mysqlnd_conn_data::get_scheme introduced in e81ecc80c was no longer able to update the socket_or_pipe in mysqlnd_conn_data::connect  with the socket filename in the event hostname == localhost. This causes a crash in mysqlnd_conn_data::connect when an attempt is made to duplicate the string to store it in conn->unix_socket.s.
>
> Thanks!
>
> -John
