mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
MDEV-33659 Fix crash in kdf() without parameters
This commit is contained in:
parent
9d806a0f76
commit
435a10e4dc
3 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
#
|
||||
|
|
|
|||
|
|
@ -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 #
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue