• evgen@moonbone.local's avatar
    Bug#33675: Usage of an uninitialized memory by filesort in a subquery caused · ce111a0d
    evgen@moonbone.local authored
    server crash.
    
    The filesort implementation has an optimization for subquery execution which
    consists of reusing previously allocated buffers. In particular the call to
    the read_buffpek_from_file function might be skipped when a big enough buffer
    for buffer descriptors (buffpeks) is already allocated. Beside allocating
    memory for buffpeks this function fills allocated buffer with data read from
    disk. Skipping it might led to using an arbitrary memory as fields' data and
    finally to a crash.
    
    Now the read_buffpek_from_file function is always called. It allocates
    new buffer only when necessary, but always fill it with correct data.
    ce111a0d
filesort.cc 44.8 KB