Fix a buffer overflow in INFORMATION_SCHEMA.GLOBAL_VARIABLES, caused by MDEV-12179

pretty_print_engine_list(): When the plugin list is empty, return
an empty string instead of allocating a buffer of 0 bytes and then
trying to write a NUL byte into it.
This commit is contained in:
Marko Mäkelä 2017-09-01 12:45:33 +03:00
parent 4e1fa7f63d
commit 8a8cca2865

View file

@ -1483,7 +1483,7 @@ pretty_print_engine_list(THD *thd, plugin_ref *list)
size_t size;
char *buf, *pos;
if (!list)
if (!list || !*list)
return thd->strmake("", 0);
size= 0;