MDEV-9698 Buffer overflow in extension_based_table_discovery()

fix a buffer overflow in extension_based_table_discovery
(that only happens in debug builds)
This commit is contained in:
Sergei Golubchik 2016-03-17 12:02:28 +01:00
parent ee687771ee
commit 8b9432ffac

View File

@ -206,7 +206,8 @@ int extension_based_table_discovery(MY_DIR *dirp, const char *ext_meta,
{
size_t len= (octothorp ? octothorp : ext) - cur->name;
if (from != cur &&
(my_strnncoll(cs, (uchar*)from->name, len, (uchar*)cur->name, len) ||
(strlen(from->name) <= len ||
my_strnncoll(cs, (uchar*)from->name, len, (uchar*)cur->name, len) ||
(from->name[len] != FN_EXTCHAR && from->name[len] != '#')))
advance(from, to, cur, skip);