Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
abe43135
Commit
abe43135
authored
Dec 22, 2006
by
msvensson@pilot.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#22694 "function plugin_foreach_with_mask() uses an uninitialized pointer"
Fix uninitialized memory.
parent
c24381bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
sql/sql_plugin.cc
sql/sql_plugin.cc
+10
-9
No files found.
sql/sql_plugin.cc
View file @
abe43135
...
...
@@ -951,29 +951,30 @@ my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
state_mask
=
~
state_mask
;
// do it only once
rw_rdlock
(
&
THR_LOCK_plugin
);
total
=
type
==
MYSQL_ANY_PLUGIN
?
plugin_array
.
elements
:
plugin_hash
[
type
].
records
;
/*
Do the alloca out here in case we do have a working alloca:
leaving the nested stack frame invalidates alloca allocation.
*/
plugins
=
(
struct
st_plugin_int
**
)
my_alloca
(
total
*
sizeof
(
*
plugins
));
if
(
type
==
MYSQL_ANY_PLUGIN
)
{
total
=
plugin_array
.
elements
;
plugins
=
(
struct
st_plugin_int
**
)
my_alloca
(
total
*
sizeof
(
*
plugins
));
for
(
idx
=
0
;
idx
<
total
;
idx
++
)
{
plugin
=
dynamic_element
(
&
plugin_array
,
idx
,
struct
st_plugin_int
*
);
if
(
plugin
->
state
&
state_mask
)
continue
;
plugins
[
idx
]
=
plugin
;
plugins
[
idx
]
=
!
(
plugin
->
state
&
state_mask
)
?
plugin
:
NULL
;
}
}
else
{
HASH
*
hash
=
&
plugin_hash
[
type
];
total
=
hash
->
records
;
plugins
=
(
struct
st_plugin_int
**
)
my_alloca
(
total
*
sizeof
(
*
plugins
));
HASH
*
hash
=
plugin_hash
+
type
;
for
(
idx
=
0
;
idx
<
total
;
idx
++
)
{
plugin
=
(
struct
st_plugin_int
*
)
hash_element
(
hash
,
idx
);
if
(
plugin
->
state
&
state_mask
)
continue
;
plugins
[
idx
]
=
plugin
;
plugins
[
idx
]
=
!
(
plugin
->
state
&
state_mask
)
?
plugin
:
NULL
;
}
}
rw_unlock
(
&
THR_LOCK_plugin
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment