mirror of
https://github.com/tmux/tmux.git
synced 2026-05-31 06:36:18 +00:00
Require layout prefix to be 5 characters, GitHub issue 5067 from
cglosner at gmail dot com.
This commit is contained in:
@@ -160,13 +160,14 @@ layout_parse(struct window *w, const char *layout, char **cause)
|
|||||||
struct window_pane *wp;
|
struct window_pane *wp;
|
||||||
u_int npanes, ncells, sx = 0, sy = 0;
|
u_int npanes, ncells, sx = 0, sy = 0;
|
||||||
u_short csum;
|
u_short csum;
|
||||||
|
int n;
|
||||||
|
|
||||||
/* Check validity. */
|
/* Check validity. */
|
||||||
if (sscanf(layout, "%hx,", &csum) != 1) {
|
if (sscanf(layout, "%hx,%n", &csum, &n) != 1 || n != 5) {
|
||||||
*cause = xstrdup("invalid layout");
|
*cause = xstrdup("invalid layout");
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
layout += 5;
|
layout += n;
|
||||||
if (csum != layout_checksum(layout)) {
|
if (csum != layout_checksum(layout)) {
|
||||||
*cause = xstrdup("invalid layout");
|
*cause = xstrdup("invalid layout");
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ window_copy_init(struct window_mode_entry *wme,
|
|||||||
struct screen *base = &wp->base;
|
struct screen *base = &wp->base;
|
||||||
struct screen_write_ctx ctx;
|
struct screen_write_ctx ctx;
|
||||||
u_int i, cx, cy;
|
u_int i, cx, cy;
|
||||||
|
|
||||||
data = window_copy_common_init(wme);
|
data = window_copy_common_init(wme);
|
||||||
data->backing = window_copy_clone_screen(base, &data->screen, &cx, &cy,
|
data->backing = window_copy_clone_screen(base, &data->screen, &cx, &cy,
|
||||||
wme->swp != wme->wp);
|
wme->swp != wme->wp);
|
||||||
|
|||||||
Reference in New Issue
Block a user