Skip to content

Commit 350c9eb

Browse files
committed
MDEV-23894 UBSAN: several call to function show_binlog_vars(THD*, st_mysql_show_var*, char*) through pointer to incorrect function type 'int (*)(THD *, st_mysql_show_var *, void *, system_status_var *, enum_var_type) errors
1 parent 33f1987 commit 350c9eb

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

sql/log.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10403,7 +10403,8 @@ binlog_checksum_update(MYSQL_THD thd, struct st_mysql_sys_var *var,
1040310403
}
1040410404

1040510405

10406-
static int show_binlog_vars(THD *thd, SHOW_VAR *var, char *buff)
10406+
static int show_binlog_vars(THD *thd, SHOW_VAR *var, void *,
10407+
system_status_var *status_var, enum_var_type)
1040710408
{
1040810409
mysql_bin_log.set_status_variables(thd);
1040910410
var->type= SHOW_ARRAY;

sql/mysqld.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8337,8 +8337,8 @@ show_ssl_get_server_not_after(THD *thd, SHOW_VAR *var, char *buff,
83378337

83388338
#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */
83398339

8340-
static int show_default_keycache(THD *thd, SHOW_VAR *var, char *buff,
8341-
enum enum_var_type scope)
8340+
static int show_default_keycache(THD *thd, SHOW_VAR *var, void *buff,
8341+
system_status_var *, enum_var_type)
83428342
{
83438343
struct st_data {
83448344
KEY_CACHE_STATISTICS stats;
@@ -8371,7 +8371,7 @@ static int show_default_keycache(THD *thd, SHOW_VAR *var, char *buff,
83718371

83728372
v->name= 0;
83738373

8374-
DBUG_ASSERT((char*)(v+1) <= buff + SHOW_VAR_FUNC_BUFF_SIZE);
8374+
DBUG_ASSERT((char*)(v+1) <= static_cast<char*>(buff) + SHOW_VAR_FUNC_BUFF_SIZE);
83758375

83768376
#undef set_one_keycache_var
83778377

@@ -8395,8 +8395,8 @@ static int show_memory_used(THD *thd, SHOW_VAR *var, char *buff,
83958395

83968396

83978397
#ifndef DBUG_OFF
8398-
static int debug_status_func(THD *thd, SHOW_VAR *var, char *buff,
8399-
enum enum_var_type scope)
8398+
static int debug_status_func(THD *thd, SHOW_VAR *var, void *buff,
8399+
system_status_var *, enum_var_type)
84008400
{
84018401
#define add_var(X,Y,Z) \
84028402
v->name= X; \

sql/wsrep_mysqld.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ extern const char* wsrep_provider_name;
131131
extern const char* wsrep_provider_version;
132132
extern const char* wsrep_provider_vendor;
133133

134-
int wsrep_show_status(THD *thd, SHOW_VAR *var, char *buff,
135-
enum enum_var_type scope);
134+
int wsrep_show_status(THD *thd, SHOW_VAR *var, void *buff,
135+
system_status_var *status_var, enum_var_type scope);
136136
int wsrep_init();
137137
void wsrep_deinit(bool free_options);
138138

sql/wsrep_var.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,8 @@ static int show_var_cmp(const void *var1, const void *var2)
726726
return strcasecmp(((SHOW_VAR*)var1)->name, ((SHOW_VAR*)var2)->name);
727727
}
728728

729-
int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff,
730-
enum enum_var_type scope)
729+
int wsrep_show_status (THD *thd, SHOW_VAR *var, void *buff,
730+
system_status_var *, enum_var_type scope)
731731
{
732732
uint i, maxi= SHOW_VAR_FUNC_BUFF_SIZE / sizeof(*var) - 1;
733733
SHOW_VAR *v= (SHOW_VAR *)buff;

0 commit comments

Comments
 (0)