From 8a8cca2865222686c0ad4336220673f6be8eb14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 1 Sep 2017 12:45:33 +0300 Subject: 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. --- sql/set_var.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/set_var.cc') diff --git a/sql/set_var.cc b/sql/set_var.cc index 606f9ac511d..311b33bc0dd 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -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; -- cgit v1.2.1