summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-02-15 10:22:03 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-02-15 10:22:03 +0200
commitb006d2ead4640f0ab4e29687fd7d24988b1c98f1 (patch)
treea478984bcd7f4bb2e0fd0496eae77b871077a380 /sql/unireg.cc
parentb782971c58b5656820429b8ef3fae5fd82f5a0f7 (diff)
parentdc09f8f29cb2b9fdce7d5d5a623fdc8dcf1814f9 (diff)
downloadmariadb-git-b006d2ead4640f0ab4e29687fd7d24988b1c98f1.tar.gz
Merge bb-10.2-ext into 10.3
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 50094ceed47..7bb08cfbf7b 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
- Copyright (c) 2009, 2013, Monty Program Ab.
+ Copyright (c) 2009, 2018, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -379,6 +379,14 @@ LEX_CUSTRING build_frm_image(THD *thd, const LEX_CSTRING *table,
DBUG_ASSERT(pos == frm_ptr + uint2korr(fileinfo+6));
key_info_length= pack_keys(pos, keys, key_info, data_offset);
+ if (key_info_length > UINT_MAX16)
+ {
+ my_printf_error(ER_CANT_CREATE_TABLE,
+ "Cannot create table %`s: index information is too long. "
+ "Decrease number of indexes or use shorter index names or shorter comments.",
+ MYF(0), table->str);
+ goto err;
+ }
int2store(forminfo+2, frm.length - filepos);
int4store(fileinfo+10, frm.length);