mirror of
https://github.com/MariaDB/server.git
synced 2026-04-22 16:25:30 +02:00
MDEV-4286 Server crashes in Protocol_text::store, stack smashing detected
AVG() returns a double, its max_length is reasonably limited by a double number length, even if the argument is many Kbytes long.
This commit is contained in:
parent
019f7425b7
commit
3827d70a0e
3 changed files with 18 additions and 2 deletions
|
|
@ -1242,9 +1242,10 @@ void Item_sum_avg::fix_length_and_dec()
|
|||
f_scale= args[0]->decimals;
|
||||
dec_bin_size= my_decimal_get_binary_size(f_precision, f_scale);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
decimals= min(args[0]->decimals + prec_increment, NOT_FIXED_DEC);
|
||||
max_length= args[0]->max_length + prec_increment;
|
||||
max_length= min(args[0]->max_length + prec_increment, float_length(decimals));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue