1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fix for CONC-505:

Don't allow to specify unsupported client flags (like
CLIENT_DEPRECATE_EOF) as client flag in mysql_real_connect
api function.
This commit is contained in:
Georg Richter
2024-02-22 09:03:51 +01:00
parent 06d0b9bfe3
commit ebe1949540
5 changed files with 44 additions and 2 deletions

View File

@@ -1433,6 +1433,14 @@ mysql_real_connect(MYSQL *mysql, const char *host, const char *user,
char *connection_handler= (mysql->options.extension) ?
mysql->options.extension->connection_handler : 0;
if ((client_flag & CLIENT_ALLOWED_FLAGS) != client_flag)
{
my_set_error(mysql, CR_INVALID_CLIENT_FLAG, SQLSTATE_UNKNOWN,
ER(CR_INVALID_CLIENT_FLAG),
client_flag, CLIENT_ALLOWED_FLAGS);
return NULL;
}
if (!mysql->methods)
mysql->methods= &MARIADB_DEFAULT_METHODS;