• unknown's avatar
    Bug#25172: Not checked buffer size leads to a server crash. · 5effa05d
    unknown authored
    After fix for bug#21798 JOIN stores the pointer to the buffer for sorting
    fields. It is used while sorting for grouping and for ordering. If ORDER BY
    clause has more elements then the GROUP BY clause then a memory overrun occurs.
    
    Now the length of the ORDER BY list is always passed to the 
    make_unireg_sortorder() function and it allocates buffer big enough to be
    used for bigger list.
    
    
    sql/sql_delete.cc:
      Bug#25172: Not checked buffer size leads to a server crash.
      Length parameter is initialized to 0 for the make_unireg_sortorder() function.
    sql/sql_select.cc:
      Bug#25172: Not checked buffer size leads to a server crash.
      Now the length of the ORDER BY list is always passed to the 
      make_unireg_sortorder() function and it allocates buffer big enough to be
      used for bigger list.
    sql/sql_table.cc:
      Bug#25172: Not checked buffer size leads to a server crash.
      Length parameter is initialized to 0 for the make_unireg_sortorder() function.
    sql/sql_update.cc:
      Bug#25172: Not checked buffer size leads to a server crash.
      Length parameter is initialized to 0 for the make_unireg_sortorder() function.
    mysql-test/r/select.result:
      Added a test case for bug#25172: Not checked buffer size leads to a server crash.
    mysql-test/t/select.test:
      Added a test case for bug#25172: Not checked buffer size leads to a server crash.
    5effa05d
sql_select.cc 476 KB