diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2018-12-19 10:34:30 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2018-12-19 10:38:46 +0530 |
commit | 7e606a2d5ca59dbd901b7c8909214a0fc12fbadd (patch) | |
tree | b3c9ae6e97a542395f6e6f41fc3f465ca7786872 /sql/table.cc | |
parent | da4efd56aa9bc3c39d94a73eb216ca7f559ce734 (diff) | |
download | mariadb-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/table.cc')
-rw-r--r-- | sql/table.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 5a34d47367a..ded79de0e83 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -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; |