From 08d1f2ca7c972ac03bfd846ff0fce019d810341e Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 2 Feb 2023 09:24:59 +0000 Subject: [PATCH] Add a missing error message which causes an invalid layout name to crash. --- usr.bin/tmux/layout-custom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/layout-custom.c b/usr.bin/tmux/layout-custom.c index 53d49e491b9..1c1dd6b1488 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.21 2022/05/30 12:52:02 nicm Exp $ */ +/* $OpenBSD: layout-custom.c,v 1.22 2023/02/02 09:24:59 nicm Exp $ */ /* * Copyright (c) 2010 Nicholas Marriott @@ -162,8 +162,10 @@ layout_parse(struct window *w, const char *layout, char **cause) u_short csum; /* Check validity. */ - if (sscanf(layout, "%hx,", &csum) != 1) + if (sscanf(layout, "%hx,", &csum) != 1) { + *cause = xstrdup("invalid layout"); return (-1); + } layout += 5; if (csum != layout_checksum(layout)) { *cause = xstrdup("invalid layout"); -- 2.20.1