1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Fixed bug #32034: On 64bit platforms assigning values of

storage engine system variables was not validated and
unexpected value was assigned.

The check_func_enum function used subtraction from the uint
value with the probably negative result. That result of
type uint was compared with 0 after casting to signed long
type. On architectures where long type is longer than int
type the result of comparison was unexpected.
This commit is contained in:
gshchepa/uchum@gleb.loc
2007-11-14 13:48:21 +04:00
parent 19c3bd89f8
commit 70f36562bc
4 changed files with 55 additions and 2 deletions

View File

@@ -1944,7 +1944,7 @@ static int check_func_enum(THD *thd, struct st_mysql_sys_var *var,
length= sizeof(buff);
if (!(str= value->val_str(value, buff, &length)))
goto err;
if ((result= find_type(typelib, str, length, 1)-1) < 0)
if ((result= (long)find_type(typelib, str, length, 1)-1) < 0)
{
strvalue= str;
goto err;