summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/april.(none)>2006-12-15 16:01:56 +0400
committerunknown <svoj@mysql.com/april.(none)>2006-12-15 16:01:56 +0400
commite071fdb6323a51254ca77ce0aebae0885e4fac42 (patch)
treea376f3ca7f73cccc9745afcf94294ed4152be979 /sql/table.cc
parent605f62ce32f6f705b0a3e35d0ac1f61eadbb0eea (diff)
downloadmariadb-git-e071fdb6323a51254ca77ce0aebae0885e4fac42.tar.gz
BUG#24358 - Table access crashes server
Having broken .frm, particulary number of field names does not match number of fields, causes server crash. Refuse to open a table if number of field names in a table is not equal to number of fields in a table. No test case, since it requires broken .frm file. sql/table.cc: Refuse to open a table if number of field names in a table is not equal to number of fields in a table.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index aff1e6d11f6..dab2f978327 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -373,6 +373,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
memcpy(comment_pos, disk_buff+read_length-com_length, com_length);
fix_type_pointers(&int_array,&outparam->fieldnames,1,&names);
+ if (outparam->fieldnames.count != outparam->fields)
+ goto err_not_open;
fix_type_pointers(&int_array,outparam->intervals,interval_count,
&names);