mirror of
https://github.com/tmux/tmux.git
synced 2026-10-06 17:49:52 +00:00
Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'
* refs/remotes/tmux-openbsd/master: Add a second comparison for key bindings to avoid ties, GitHub issue 5647 from Alexandre Fiori. Bounds check size and offsets for v1 layouts, found by ossfuzz.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: layout-custom.c,v 1.43 2026/09/22 06:48:01 nicm Exp $ */
|
||||
/* $OpenBSD: layout-custom.c,v 1.44 2026/09/28 09:32:06 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -826,7 +826,12 @@ layout_construct_cell(struct layout_cell *lcparent, const char **layout)
|
||||
|
||||
if (!isdigit((u_char) **layout))
|
||||
return (NULL);
|
||||
if (sscanf(*layout, "%ux%u,%d,%d", &sx, &sy, &xoff, &yoff) != 4)
|
||||
if (sscanf(*layout, "%5ux%5u,%5d,%5d", &sx, &sy, &xoff, &yoff) != 4)
|
||||
return (NULL);
|
||||
if (sx < PANE_MINIMUM || sx > PANE_MAXIMUM ||
|
||||
sy < PANE_MINIMUM || sy > PANE_MAXIMUM ||
|
||||
xoff < 0 || xoff > WINDOW_MAXIMUM ||
|
||||
yoff < 0 || yoff > WINDOW_MAXIMUM)
|
||||
return (NULL);
|
||||
|
||||
while (isdigit((u_char) **layout))
|
||||
|
||||
12
sort.c
12
sort.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: sort.c,v 1.10 2026/08/25 07:23:30 nicm Exp $ */
|
||||
/* $OpenBSD: sort.c,v 1.11 2026/09/28 09:41:53 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2026 Dane Jensen <dhcjensen@gmail.com>
|
||||
@@ -312,7 +312,7 @@ sort_key_binding_cmp(const void *a0, const void *b0)
|
||||
(b->key & KEYC_MASK_MODIFIERS);
|
||||
break;
|
||||
case SORT_NAME:
|
||||
result = strcasecmp(a->tablename, b->tablename) == 0;
|
||||
result = strcasecmp(a->tablename, b->tablename);
|
||||
break;
|
||||
case SORT_ACTIVITY:
|
||||
case SORT_CREATION:
|
||||
@@ -324,7 +324,13 @@ sort_key_binding_cmp(const void *a0, const void *b0)
|
||||
}
|
||||
|
||||
if (result == 0)
|
||||
result = strcasecmp(a->tablename, b->tablename) == 0;
|
||||
result = strcasecmp(a->tablename, b->tablename);
|
||||
if (result == 0) {
|
||||
if (a->key < b->key)
|
||||
result = -1;
|
||||
else if (a->key > b->key)
|
||||
result = 1;
|
||||
}
|
||||
|
||||
if (sort_crit->reversed)
|
||||
result = -result;
|
||||
|
||||
Reference in New Issue
Block a user