summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-11-17 17:51:01 +0400
committerAlexander Barkov <bar@mariadb.com>2022-11-17 17:51:01 +0400
commit6216a2dfa2faabf8abfd3099a6cd46b00cef4115 (patch)
tree219818f8934e80d7c7f531bc9391ce3a902a32fe /plugin
parentdf4c3d96a4aba0e5a9af3bd5158cd2049a978130 (diff)
downloadmariadb-git-6216a2dfa2faabf8abfd3099a6cd46b00cef4115.tar.gz
MDEV-29473 UBSAN: Signed integer overflow: X * Y cannot be represented in type 'int' in strings/dtoa.c
Fixing a few problems relealed by UBSAN in type_float.test - multiplication overflow in dtoa.c - uninitialized Field::geom_type (and Field::srid as well) - Wrong call-back function types used in combination with SHOW_FUNC. Changes in the mysql_show_var_func data type definition were not properly addressed all around the code by the following commits: b4ff64568c88ab3ce559e7bd39853d9cbf86704a 18feb62feeb833494d003615861b9c78ec008a90 0ee879ff8ac1b80cd9a963015344f5698a81f309 Adding a helper SHOW_FUNC_ENTRY() function and replacing all mysql_show_var_func declarations using SHOW_FUNC to SHOW_FUNC_ENTRY, to catch mysql_show_var_func in the future at compilation time.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/handler_socket/handlersocket/handlersocket.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugin/handler_socket/handlersocket/handlersocket.cpp b/plugin/handler_socket/handlersocket/handlersocket.cpp
index 8133497044c..45c9e13b2ca 100644
--- a/plugin/handler_socket/handlersocket/handlersocket.cpp
+++ b/plugin/handler_socket/handlersocket/handlersocket.cpp
@@ -185,7 +185,9 @@ static SHOW_VAR hs_status_variables[] = {
{NullS, NullS, SHOW_LONG}
};
-static int show_hs_vars(THD *thd, SHOW_VAR *var, char *buff)
+static int show_hs_vars(THD *thd, SHOW_VAR *var, void *buff,
+ struct system_status_var *status_var,
+ enum enum_var_type var_type)
{
var->type= SHOW_ARRAY;
var->value= (char *) &hs_status_variables;
@@ -193,7 +195,7 @@ static int show_hs_vars(THD *thd, SHOW_VAR *var, char *buff)
}
static SHOW_VAR daemon_handlersocket_status_variables[] = {
- {"Hs", (char*) show_hs_vars, SHOW_FUNC},
+ SHOW_FUNC_ENTRY("Hs", &show_hs_vars),
{NullS, NullS, SHOW_LONG}
};