**Describe the bug**
https://clickhouse-test-reports.s3.yandex.net/19702/c74631c650b42e4d107254a03bd82c2c2913039b/fuzzer_msan/server.log

Most likely introduced here: #11006
{
    if (equal_range.empty())
        return;
    if (limit >= data.size() || limit >= equal_range.back().second)
        limit = 0;
    EqualRanges new_ranges;
    SCOPE_EXIT({equal_range = std::move(new_ranges);});
    for (size_t i = 0; i < equal_range.size() - bool(limit); ++i)
    {
        const auto & [first, last] = equal_range[i];
        if (reverse)
            pdqsort(res.begin() + first, res.begin() + last, greater(*this, nan_direction_hint));
        else
            pdqsort(res.begin() + first, res.begin() + last, less(*this, nan_direction_hint));
        size_t new_first = first;
        for (size_t j = first + 1; j < last; ++j)
        {
            if (less(*this, nan_direction_hint)(res[j], res[new_first]) || greater(*this, nan_direction_hint)(res[j], res[new_first]))
            {
                if (j - new_first > 1)
                {
                    new_ranges.emplace_back(new_first, j);
                }
                new_first = j;
            }