1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
Bug: http://bugs.mysql.com/bug.php?id=62769
Bug-Ubuntu: http://pad.lv/700982
Description: make sure va_list usage is portable to fix FTBFS on ARM
Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
Last-Update: 2012-10-24
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -233,11 +233,13 @@
{
MYSQL mysql;
struct st_mysql_client_plugin **builtin;
+ va_list unused;
if (initialized)
return 0;
bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
+ bzero(&unused, sizeof(unused)); /* suppress uninitialized-value warnings */
pthread_mutex_init(&LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW);
init_alloc_root(&mem_root, 128, 128);
@@ -249,7 +251,7 @@
pthread_mutex_lock(&LOCK_load_client_plugin);
for (builtin= mysql_client_builtins; *builtin; builtin++)
- add_plugin(&mysql, *builtin, 0, 0, 0);
+ add_plugin(&mysql, *builtin, 0, 0, unused);
pthread_mutex_unlock(&LOCK_load_client_plugin);
@@ -293,9 +295,13 @@
mysql_client_register_plugin(MYSQL *mysql,
struct st_mysql_client_plugin *plugin)
{
+ va_list unused;
+
if (is_not_initialized(mysql, plugin->name))
return NULL;
+ bzero(&unused, sizeof(unused)); /* suppress uninitialized-value warnings */
+
pthread_mutex_lock(&LOCK_load_client_plugin);
/* make sure the plugin wasn't loaded meanwhile */
@@ -307,7 +313,7 @@
plugin= NULL;
}
else
- plugin= add_plugin(mysql, plugin, 0, 0, 0);
+ plugin= add_plugin(mysql, plugin, 0, 0, unused);
pthread_mutex_unlock(&LOCK_load_client_plugin);
return plugin;
|