You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
CONPY-704: parse_connection_string ignores empty string in last parameter
1) Fix check if end was reached (<= instead of <), so last parameter will not be ignored in case it is an empty string. 2) Empty strings will be passed as NULL`in _mariadb_set_conf_option.
This commit is contained in:
@@ -811,7 +811,10 @@ my_bool _mariadb_set_conf_option(MYSQL *mysql, const char *config_option, const
|
||||
option_val= &val_sizet;
|
||||
break;
|
||||
case MARIADB_OPTION_STR:
|
||||
option_val= (void*)config_value;
|
||||
if (config_value && !config_value[0])
|
||||
option_val= NULL;
|
||||
else
|
||||
option_val= (void*)config_value;
|
||||
break;
|
||||
case MARIADB_OPTION_NONE:
|
||||
break;
|
||||
@@ -907,7 +910,7 @@ static int parse_connection_string(MYSQL *mysql, const char *unused __attribute_
|
||||
if (!key)
|
||||
goto error;
|
||||
*pos++= 0;
|
||||
if (pos < end)
|
||||
if (pos <= end)
|
||||
val= pos;
|
||||
continue;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user