change_uid_gid() never initialises sz which may cause greedy_realloc to skip the initial buffer allocation.