diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-04-26 14:01:21 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-04-26 14:01:21 +0400 |
commit | 5cfc7799a33576bb638652bac6e341570c80a7e1 (patch) | |
tree | 45f7457a79727edf022a08bb40f33b8749e0b233 /sql/table.cc | |
parent | 9a5a86f293b6fe40ad606de43c04a2d8ba6b60b1 (diff) | |
download | mariadb-git-5cfc7799a33576bb638652bac6e341570c80a7e1.tar.gz |
MDEV-16518 MYSQL57_GENERATED_FIELD: The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 2cf21c889e2..5337a506215 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1839,7 +1839,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write, goto err; vcol_info= new (&share->mem_root) Virtual_column_info(); vcol_info_length= uint2korr(vcol_screen_pos + 1); - DBUG_ASSERT(vcol_info_length); + if (!vcol_info_length) // Expect non-empty expression + goto err; vcol_info->stored_in_db= vcol_screen_pos[3]; vcol_info->utf8= 0; vcol_screen_pos+= vcol_info_length + MYSQL57_GCOL_HEADER_SIZE;; |