Bug#31752: check strmake() bounds
fix test program client/mysqltest.c: fix buffer off-by-ones in test program
This commit is contained in:
parent
0805384869
commit
9295bc3465
@ -3067,7 +3067,7 @@ void do_get_file_name(struct st_command *command,
|
|||||||
if (*p)
|
if (*p)
|
||||||
*p++= 0;
|
*p++= 0;
|
||||||
command->last_argument= p;
|
command->last_argument= p;
|
||||||
strmake(dest, name, dest_max_len);
|
strmake(dest, name, dest_max_len - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -6375,7 +6375,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
if (save_file[0])
|
if (save_file[0])
|
||||||
{
|
{
|
||||||
strmake(command->require_file, save_file, sizeof(save_file));
|
strmake(command->require_file, save_file, sizeof(save_file) - 1);
|
||||||
save_file[0]= 0;
|
save_file[0]= 0;
|
||||||
}
|
}
|
||||||
run_query(cur_con, command, flags);
|
run_query(cur_con, command, flags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user