Do not include unattached clients on sorted list, fixes crash reported

by Marcel Partap.
This commit is contained in:
nicm
2026-05-17 11:17:16 +00:00
parent 818352c3cd
commit 35bd1a4c02

4
sort.c
View File

@@ -425,6 +425,10 @@ sort_get_clients(u_int *n, struct sort_criteria *sort_crit)
i = 0; i = 0;
TAILQ_FOREACH(c, &clients, entry) { TAILQ_FOREACH(c, &clients, entry) {
if (c->flags & CLIENT_UNATTACHEDFLAGS)
continue;
if (~c->flags & CLIENT_ATTACHED)
continue;
if (lsz <= i) { if (lsz <= i) {
lsz += 100; lsz += 100;
l = xreallocarray(l, lsz, sizeof *l); l = xreallocarray(l, lsz, sizeof *l);