mirror of
https://github.com/tmux/tmux.git
synced 2026-10-07 02:04:22 +00:00
Do not pass NULL to qsort, and add checks for invalid session or window
after swap.
This commit is contained in:
4
sort.c
4
sort.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: sort.c,v 1.9 2026/06/29 07:45:09 nicm Exp $ */
|
||||
/* $OpenBSD: sort.c,v 1.10 2026/08/25 07:23:30 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2026 Dane Jensen <dhcjensen@gmail.com>
|
||||
@@ -32,7 +32,7 @@ sort_qsort(void *l, u_int len, u_int size, int (*cmp)(const void *,
|
||||
u_int i;
|
||||
void *tmp, **ll;
|
||||
|
||||
if (sort_crit->order == SORT_END)
|
||||
if (len < 2 || sort_crit->order == SORT_END)
|
||||
return;
|
||||
|
||||
if (sort_crit->order == SORT_ORDER) {
|
||||
|
||||
Reference in New Issue
Block a user