=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/format-draw.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/tmux/format-draw.c 2019/03/18 21:55:04 1.2 --- src/usr.bin/tmux/format-draw.c 2019/03/20 07:13:02 1.3 *************** *** 1,4 **** ! /* $OpenBSD: format-draw.c,v 1.2 2019/03/18 21:55:04 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: format-draw.c,v 1.3 2019/03/20 07:13:02 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott *************** *** 527,532 **** --- 527,533 ---- style_set(&sy, base); TAILQ_INIT(&frs); + log_debug("%s: %s", __func__, expanded); /* * We build three screens for left, right, centre alignment, one for *************** *** 574,583 **** /* This is a style. Work out where the end is and parse it. */ end = format_skip(cp + 2, "]"); ! if (end == NULL) return; tmp = xstrndup(cp + 2, end - (cp + 2)); if (style_parse(&sy, base, tmp) != 0) { free(tmp); return; } --- 575,587 ---- /* This is a style. Work out where the end is and parse it. */ end = format_skip(cp + 2, "]"); ! if (end == NULL) { ! log_debug("no terminating ] at '%s'", cp + 2); return; + } tmp = xstrndup(cp + 2, end - (cp + 2)); if (style_parse(&sy, base, tmp) != 0) { + log_debug("invalid style '%s'", tmp); free(tmp); return; }