1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-34090 Client allows to set character set to utf32 and crashes on the next command

Disallowing character sets with mbminlen>1 in the client.
This commit is contained in:
Alexander Barkov
2024-11-07 12:16:33 +04:00
parent 425d2521ec
commit 225c17d35c
3 changed files with 24 additions and 0 deletions

View File

@@ -3292,6 +3292,9 @@ static int com_charset(String *, char *line)
new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));
if (new_cs)
{
if (new_cs->mbminlen > 1)
return put_info("Character sets with mbminlen>1 are not supported",
INFO_ERROR, 0);
charset_info= new_cs;
mysql_set_character_set(&mysql, charset_info->csname);
default_charset= (char *)charset_info->csname;