summaryrefslogtreecommitdiff
path: root/sql/partition_info.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2018-12-19 10:34:30 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2018-12-19 10:38:46 +0530
commit7e606a2d5ca59dbd901b7c8909214a0fc12fbadd (patch)
treeb3c9ae6e97a542395f6e6f41fc3f465ca7786872 /sql/partition_info.cc
parentda4efd56aa9bc3c39d94a73eb216ca7f559ce734 (diff)
downloadmariadb-git-7e606a2d5ca59dbd901b7c8909214a0fc12fbadd.tar.gz
MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) fieldbb-10.0-varun
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.
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r--sql/partition_info.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index e6a30c8a7f0..7106e741331 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -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);
}