mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#48983: Bad strmake calls (length one too long)
MySQL 5.1 specific fixes.
This commit is contained in:
@ -117,13 +117,13 @@ static void parse_option(const char *option_str,
|
||||
while (*ptr == '-')
|
||||
++ptr;
|
||||
|
||||
strmake(option_name_buf, ptr, MAX_OPTION_LEN + 1);
|
||||
strmake(option_name_buf, ptr, MAX_OPTION_LEN);
|
||||
|
||||
eq_pos= strchr(ptr, '=');
|
||||
if (eq_pos)
|
||||
{
|
||||
option_name_buf[eq_pos - ptr]= 0;
|
||||
strmake(option_value_buf, eq_pos + 1, MAX_OPTION_LEN + 1);
|
||||
strmake(option_value_buf, eq_pos + 1, MAX_OPTION_LEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -533,10 +533,10 @@ static int setup_windows_defaults()
|
||||
return 1;
|
||||
}
|
||||
|
||||
strmake(base_name, base_name_ptr, FN_REFLEN);
|
||||
strmake(base_name, base_name_ptr, FN_REFLEN - 1);
|
||||
*base_name_ptr= 0;
|
||||
|
||||
strmake(im_name, base_name, FN_REFLEN);
|
||||
strmake(im_name, base_name, FN_REFLEN - 1);
|
||||
ptr= strrchr(im_name, '.');
|
||||
|
||||
if (!ptr)
|
||||
|
@ -25,7 +25,7 @@
|
||||
User::User(const LEX_STRING *user_name_arg, const char *password)
|
||||
{
|
||||
user_length= (uint8) (strmake(user, user_name_arg->str,
|
||||
USERNAME_LENGTH + 1) - user);
|
||||
USERNAME_LENGTH) - user);
|
||||
set_password(password);
|
||||
}
|
||||
|
||||
|
@ -2084,7 +2084,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
|
||||
&error, &error_len, ¬_used);
|
||||
if (error_len)
|
||||
{
|
||||
strmake(buff, error, min(sizeof(buff), error_len));
|
||||
strmake(buff, error, min(sizeof(buff) - 1, error_len));
|
||||
strvalue= buff;
|
||||
goto err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user