You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Merge pull request #262 from markus456/3.4
CONC-741: Check that MYSQL_STMT is not null
This commit is contained in:
@@ -129,7 +129,7 @@ static my_bool madb_have_pending_results(MYSQL_STMT *stmt)
|
|||||||
{
|
{
|
||||||
LIST *li_stmt;
|
LIST *li_stmt;
|
||||||
|
|
||||||
if (!stmt->mysql)
|
if (!stmt || !stmt->mysql)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
li_stmt= stmt->mysql->stmts;
|
li_stmt= stmt->mysql->stmts;
|
||||||
|
@@ -1662,6 +1662,13 @@ static int test_disable_tls1_0(MYSQL *my __attribute__((unused)))
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int test_null_handles(MYSQL *)
|
||||||
|
{
|
||||||
|
mysql_close(NULL);
|
||||||
|
mysql_stmt_close(NULL);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct my_tests_st my_tests[] = {
|
struct my_tests_st my_tests[] = {
|
||||||
{"test_disable_tls1_0", test_disable_tls1_0, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
{"test_disable_tls1_0", test_disable_tls1_0, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||||
@@ -1707,7 +1714,8 @@ struct my_tests_st my_tests[] = {
|
|||||||
{"test_ldi_path", test_ldi_path, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
{"test_ldi_path", test_ldi_path, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
{"test_conc44", test_conc44, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
{"test_conc44", test_conc44, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
{"test_null_handles", test_null_handles, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||||
{NULL, NULL, 0, 0, NULL, 0}
|
{NULL, NULL, 0, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user