summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-09-01 12:45:33 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-09-01 12:47:50 +0300
commit8a8cca2865222686c0ad4336220673f6be8eb14c (patch)
tree8f53baebaec767fcca0eeb6ef21f96ed216871db /sql/set_var.cc
parent4e1fa7f63da580c1e0e4256bc4af3c02cdc51939 (diff)
downloadmariadb-git-8a8cca2865222686c0ad4336220673f6be8eb14c.tar.gz
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.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc2
1 files changed, 1 insertions, 1 deletions
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;