diff --git a/usr.bin/tmux/layout-custom.c b/usr.bin/tmux/layout-custom.c index 7833938f0a6..2ddfb97c7e2 100644 --- a/usr.bin/tmux/layout-custom.c +++ b/usr.bin/tmux/layout-custom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: layout-custom.c,v 1.24 2026/04/04 16:40:27 nicm Exp $ */ +/* $OpenBSD: layout-custom.c,v 1.25 2026/05/07 09:21:05 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -160,13 +160,14 @@ layout_parse(struct window *w, const char *layout, char **cause) struct window_pane *wp; u_int npanes, ncells, sx = 0, sy = 0; u_short csum; + int n; /* Check validity. */ - if (sscanf(layout, "%hx,", &csum) != 1) { + if (sscanf(layout, "%hx,%n", &csum, &n) != 1 || n != 5) { *cause = xstrdup("invalid layout"); return (-1); } - layout += 5; + layout += n; if (csum != layout_checksum(layout)) { *cause = xstrdup("invalid layout"); return (-1); diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 1f2b89dca56..5ed2791d857 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.397 2026/05/07 09:15:44 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.398 2026/05/07 09:21:05 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -469,7 +469,7 @@ window_copy_init(struct window_mode_entry *wme, struct screen *base = &wp->base; struct screen_write_ctx ctx; u_int i, cx, cy; - + data = window_copy_common_init(wme); data->backing = window_copy_clone_screen(base, &data->screen, &cx, &cy, wme->swp != wme->wp);