1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +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 3228ed2ea3
commit 55fe56fa42
5 changed files with 44 additions and 3 deletions

View File

@@ -1444,6 +1444,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;