Commit fde52a2f authored by unknown's avatar unknown

BUG#24401 - MySQL server crashes if you try to retrieve data from

            corrupted table

Accessing a table with corrupted column definition results in server
crash.

This is fixed by refusing to open such tables. Affects MyISAM only.
No test case, since it requires crashed table.


myisam/mi_open.c:
  Refuse to open MyISAM table with summary columns length bigger than
  length of the record.
parent f509e774
...@@ -435,6 +435,13 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -435,6 +435,13 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
offset+=share->rec[i].length; offset+=share->rec[i].length;
} }
share->rec[i].type=(int) FIELD_LAST; /* End marker */ share->rec[i].type=(int) FIELD_LAST; /* End marker */
if (offset > share->base.reclength)
{
/* purecov: begin inspected */
my_errno= HA_ERR_CRASHED;
goto err;
/* purecov: end */
}
if (! lock_error) if (! lock_error)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment