Skip to content

Commit

Permalink
Fix a buffer overflow in INFORMATION_SCHEMA.GLOBAL_VARIABLES, caused …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
dr-m committed Sep 1, 2017
1 parent 4e1fa7f commit 8a8cca2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql/set_var.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8a8cca2

Please sign in to comment.