Skip to content

Commit 59de2c0

Browse files
committed
Fixed bug #70572 segfault in mysqlnd_connect
1 parent 85be6fe commit 59de2c0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ PHP NEWS
2020
(Andrey)
2121
. Fixed bug #70456 (mysqlnd doesn't activate TCP keep-alive when connecting to
2222
a server). (Sergei Turchanov)
23+
. Fixed bug #70572 segfault in mysqlnd_connect. (Andrey, Remi)
2324

2425
- OpenSSL:
2526
. Fixed bug #55259 (openssl extension does not get the DH parameters from

ext/mysqlnd/mysqlnd_net.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
206206
if (hashed_details) {
207207
mnd_sprintf_free(hashed_details);
208208
}
209-
errcode = CR_CONNECTION_ERROR;
210-
SET_CLIENT_ERROR(*error_info, errcode? errcode:CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, errstr);
209+
SET_CLIENT_ERROR(*error_info,
210+
CR_CONNECTION_ERROR,
211+
UNKNOWN_SQLSTATE,
212+
errstr? errstr:"Unknown error while connecting");
211213
if (errstr) {
212214
/* no mnd_ since we don't allocate it */
213215
efree(errstr);

0 commit comments

Comments
 (0)