Skip to content

Commit 35a60ab

Browse files
author
Bogdan Degtyariov
committed
Calling MySQLDrivercConnect with a NULL pcbConnStrOut causes a crash (Bug# 27101767/88371)
1 parent db1f67a commit 35a60ab

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
(Bug# 27155880/86473)
1313
* MySQL Connector/ODBC 5.2.5 - Command Timeout does not work
1414
(Bug# 26474362/69416)
15+
* Calling MySQLDrivercConnect with a NULL pcbConnStrOut causes a crash
16+
(Bug# 27101767/88371)
1517

1618
Built using MySQL 5.7.20
1719

@@ -94,6 +96,7 @@
9496
* Assertion in ODBC Driver when calling mysql_stmt_close() on a broken
9597
connection (Bug# 25109356/83858)
9698
* Connector ODBC does not build with newer CMake (Bug# 22746557)
99+
* Installation fails in OSX El Capitan (23123503/81113)
97100

98101
Built using MySQL 5.7.17.
99102

driver/unicode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,14 @@ SQLDriverConnectW(SQLHDBC hdbc, SQLHWND hwnd,
243243
SQLWCHAR *out, SQLSMALLINT out_max, SQLSMALLINT *out_len,
244244
SQLUSMALLINT completion)
245245
{
246+
SQLSMALLINT dummy_out_len = 0;
247+
246248
CHECK_HANDLE(hdbc);
247249

250+
// Make sure out_len is never NULL at least internally
251+
if (!out_len)
252+
out_len = &dummy_out_len;
253+
248254
((DBC *)hdbc)->unicode= TRUE; /* Hooray, a Unicode connection! */
249255

250256
return MySQLDriverConnect(hdbc, hwnd, in, in_len, out, out_max,

test/my_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ DECLARE_TEST(t_query_timeout)
526526

527527
ok_sql(hstmt, "DROP TABLE if exists t_query_timeout1");
528528

529-
/* Just in case there is a small delay in the network or somewhere else */
530-
is(t2 - t1 < 3);
529+
/* Just in case there is a delay in the network or somewhere else */
530+
is(t2 - t1 < 5);
531531
}
532532
return OK;
533533
}

0 commit comments

Comments
 (0)