Skip to content

Commit

Permalink
FRM: fail to load extra2 option with size 1 fix
Browse files Browse the repository at this point in the history
From comment in unreg.h:

  Types of values in the MariaDB extra2 frm segment.
  Each value is written as
    type:       1 byte
    length:     1 byte  (1..255) or \0 and 2 bytes.
    binary value of the 'length' bytes.

length == 1 is valid.
  • Loading branch information
midenok authored and Sergey Vojtovich committed Nov 29, 2017
1 parent 0c6ff12 commit 51b3058
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/table.cc
Expand Up @@ -1221,7 +1221,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
if (*extra2 != '/') // old frm had '/' there
{
const uchar *e2end= extra2 + len;
while (extra2 + 3 < e2end)
while (extra2 + 3 <= e2end)
{
uchar type= *extra2++;
size_t length= *extra2++;
Expand Down

0 comments on commit 51b3058

Please sign in to comment.