Fix incorrectly initialized character array

Bug #1075757 reported by Keyur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
New
Undecided
Unassigned

Bug Description

Google's Address Sanitizer detected the following array out of bounds bug (http://code.google.com/p/address-sanitizer/wiki/ExampleGlobalOutOfBounds)

The log_warnings_suppress_name is read to initialize the Sys_var_set and the constructor depends on the NULL to detect the last element.

diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 4c98bed..76e3d7a 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1597,7 +1597,7 @@ static Sys_var_uint Sys_port(
        READ_ONLY GLOBAL_VAR(mysqld_port), CMD_LINE(REQUIRED_ARG, 'P'),
        VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1));

-const char *log_warnings_suppress_name[]= { "1592" };
+const char *log_warnings_suppress_name[]= { "1592", NULL };
 static Sys_var_set Sys_log_warnings_suppress(
        "log_warnings_suppress",
        "disable logging of enumerated warnings: "

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.