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:
@@ -1990,12 +1990,12 @@ bool partition_info::check_partition_field_length()
|
||||
|
||||
for (i= 0; i < num_part_fields; i++)
|
||||
store_length+= get_partition_field_store_length(part_field_array[i]);
|
||||
if (store_length > MAX_KEY_LENGTH)
|
||||
if (store_length > MAX_DATA_LENGTH_FOR_KEY)
|
||||
DBUG_RETURN(TRUE);
|
||||
store_length= 0;
|
||||
for (i= 0; i < num_subpart_fields; i++)
|
||||
store_length+= get_partition_field_store_length(subpart_field_array[i]);
|
||||
if (store_length > MAX_KEY_LENGTH)
|
||||
if (store_length > MAX_DATA_LENGTH_FOR_KEY)
|
||||
DBUG_RETURN(TRUE);
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user