summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-07-08 19:38:26 +0200
committerSergei Golubchik <sergii@pisem.net>2014-07-08 19:38:26 +0200
commitca2ba2291af7e93893febed414e2ae98a5abd543 (patch)
treea081b1b1e70dff70cf5855c841f03e8637b46d5e /sql/unireg.cc
parent65f85264a4c5319ee161545f60de99468b2382e5 (diff)
downloadmariadb-git-ca2ba2291af7e93893febed414e2ae98a5abd543.tar.gz
MDEV-6224 Incorrect information in file when *.frm is > 256K
Reject huge frms at CREATE TABLE, not when it - successfully written - is being opened. Also raise the frm size limit from 256K to 512K
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index b7ac8b17c38..c60a13e5f44 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -211,6 +211,12 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
filepos= frm.length;
frm.length+= FRM_FORMINFO_SIZE; // forminfo
frm.length+= packed_fields_length(create_fields);
+
+ if (frm.length > FRM_MAX_SIZE)
+ {
+ my_error(ER_TABLE_DEFINITION_TOO_BIG, MYF(0), table);
+ DBUG_RETURN(frm);
+ }
frm_ptr= (uchar*) my_malloc(frm.length, MYF(MY_WME | MY_ZEROFILL |
MY_THREAD_SPECIFIC));