From 34b08eb8ac314e4024f6d9a6ce032220f9d1bcdf Mon Sep 17 00:00:00 2001 From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] 0111-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 c5388340..0cc7f992 100644 --- a/top/top.c +++ b/top/top.c @@ -3618,7 +3618,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++;