From 23baeb1175c2c8df840825c5111884aa04f8ce37 Mon Sep 17 00:00:00 2001 From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] top: Limit Width_mode to SCREENMAX. adj_geometry() limits to SCREENMAX too, but belt and suspenders, and might as well tell the user about it. --- top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/top/top.c b/top/top.c index 7eb1c660..62137217 100644 --- a/top/top.c +++ b/top/top.c @@ -4112,7 +4112,7 @@ static void parse_args (char **args) { if (cp[1]) pn = &cp[1]; else if (*args) { pn = *args; ai = 1; } if (pn && !(ci = strspn(pn, numbs_str))) { ai = 0; pn = NULL; } - if (pn && (!mkfloat(pn, &tmp, 1) || tmp < W_MIN_COL)) + if (pn && (!mkfloat(pn, &tmp, 1) || tmp < W_MIN_COL || tmp > SCREENMAX)) error_exit(fmtmk(N_fmt(BAD_widtharg_fmt), pn)); Width_mode = (int)tmp; cp++;