https://fedorahosted.org/sssd/ticket/1894
Reproducer:
group-1 -> group-2 -> enough groups that it triggers AD range retrieval
getent group group-1
I used 3000 groups and 1500 users.
There is only one member in group-1 so it is processed with single step.
AD will return maximum 1500 values per attribute by default, so we
allocate space for 1500 groups. Then ASQ is called and returns 4500
members so we end up writing after allocated space.
Normally, we split the members to users, groups and unknown objects and
allocate space for groups + unknown. But I don't think it is necessary
to do the split here again. We allocate potentially more space than
required and then shrink it to the correct size.