mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +01:00
filesort.cc:
Bug#33675: Usage of an uninitialized memory by filesort in a subquery caused server crash. Free smaller buffer before allocating bigger one.
This commit is contained in:
parent
165dfa3eba
commit
830b8f0e30
1 changed files with 6 additions and 2 deletions
|
@ -239,10 +239,14 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer)
|
||||
{
|
||||
x_free(table_sort.buffpek);
|
||||
table_sort.buffpek= 0;
|
||||
}
|
||||
if (!(table_sort.buffpek=
|
||||
read_buffpek_from_file(&buffpek_pointers, maxbuffer,
|
||||
(table_sort.buffpek_len < maxbuffer ?
|
||||
NULL : table_sort.buffpek))))
|
||||
table_sort.buffpek)))
|
||||
goto err;
|
||||
buffpek= (BUFFPEK *) table_sort.buffpek;
|
||||
table_sort.buffpek_len= maxbuffer;
|
||||
|
|
Loading…
Reference in a new issue