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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
435a10e4
Commit
435a10e4
authored
Mar 25, 2024
by
Andre Alves
Committed by
Andrew Hutchings
Apr 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-33659 Fix crash in kdf() without parameters
parent
9d806a0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
mysql-test/main/func_kdf.result
mysql-test/main/func_kdf.result
+5
-0
mysql-test/main/func_kdf.test
mysql-test/main/func_kdf.test
+7
-0
sql/item_create.cc
sql/item_create.cc
+5
-1
No files found.
mysql-test/main/func_kdf.result
View file @
435a10e4
...
...
@@ -154,5 +154,10 @@ NULL
Warnings:
Warning 3047 Invalid argument error: 65537 in function kdf.
#
# MDEV-33659 Test kdf() without parameters
#
select kdf();
ERROR 42000: Incorrect parameter count in the call to native function 'kdf'
#
# End of 11.3 tests
#
mysql-test/main/func_kdf.test
View file @
435a10e4
...
...
@@ -51,6 +51,13 @@ select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 32768));
select
length
(
kdf
(
'foo'
,
'bar'
,
100
,
'pbkdf2_hmac'
,
65536
));
select
length
(
kdf
(
'foo'
,
'bar'
,
100
,
'pbkdf2_hmac'
,
65537
));
--
echo
#
--
echo
# MDEV-33659 Test kdf() without parameters
--
echo
#
--
error
ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
select
kdf
();
--
echo
#
--
echo
# End of 11.3 tests
--
echo
#
...
...
sql/item_create.cc
View file @
435a10e4
...
...
@@ -3229,8 +3229,12 @@ Item*
Create_func_kdf
::
create_native
(
THD
*
thd
,
const
LEX_CSTRING
*
name
,
List
<
Item
>
*
item_list
)
{
uint
arg_count
=
item_list
->
elements
;
Item
*
a
[
5
];
uint
arg_count
=
0
;
if
(
item_list
!=
NULL
)
arg_count
=
item_list
->
elements
;
for
(
uint
i
=
0
;
i
<
MY_MIN
(
array_elements
(
a
),
arg_count
);
i
++
)
a
[
i
]
=
item_list
->
pop
();
switch
(
arg_count
)
...
...
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