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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user