From 723862262124d5494a3d77bf6ac0759618ac69ca Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 5 Jan 2022 13:51:44 +0200 Subject: [PATCH] Fix segfault in hypothetical case of huge COLNO --- src/mdlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mdlib.c b/src/mdlib.c index 66cc2b893..ceb43643b 100644 --- a/src/mdlib.c +++ b/src/mdlib.c @@ -90,7 +90,7 @@ static void build_savebones_compat_string(void); static int idxopttext, done_runtime_opt_init_once = 0; #define MAXOPT 40 static char *opttext[120] = { 0 }; -char optbuf[BUFSZ]; +char optbuf[COLBUFSZ]; static struct version_info version; static const char opt_indent[] = " "; @@ -660,7 +660,7 @@ opt_out_words(char *str, /* input, but modified during processing */ void build_options(void) { - char buf[BUFSZ]; + char buf[COLBUFSZ]; int i, length, winsyscnt, cnt = 0; const char *defwinsys = DEFAULT_WINDOW_SYS;