mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
Create a new constant MAX_DATA_LENGTH_FOR_KEY. Replace the value of MAX_KEY_LENGTH to also include the LENGTH and NULL BYTES of a field.
This commit is contained in:
@@ -1816,7 +1816,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
|
||||
uint pk_part_length= key_first_info->key_part[i].store_length;
|
||||
if (keyinfo->ext_key_part_map & 1<<i)
|
||||
{
|
||||
if (ext_key_length + pk_part_length > MAX_KEY_LENGTH)
|
||||
if (ext_key_length + pk_part_length > MAX_DATA_LENGTH_FOR_KEY)
|
||||
{
|
||||
add_keyparts_for_this_key= i;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user