Commit 51b30586 authored by Aleksey Midenkov's avatar Aleksey Midenkov Committed by Sergey Vojtovich

FRM: fail to load extra2 option with size 1 fix

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.
parent 0c6ff122
......@@ -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++;
......
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