From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 (+0000) Subject: 0103-top: Protect macro parameters. X-Git-Tag: v4.0.0~577 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b2909348171c03cd4e343388b6717ea5c9a5550;p=procps-ng 0103-top: Protect macro parameters. ---------------------------- adapted for newlib branch . the 'isBUSY' macro is quite different under newlib Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index 5939ea88..9bf8e54e 100644 --- a/top/top.c +++ b/top/top.c @@ -5404,8 +5404,8 @@ static int window_show (WIN_t *q, int wmax) { /* the isBUSY macro determines if a task is 'active' -- it returns true if some cpu was used since the last sample. ( actual 'running' tasks will be a subset of those selected ) */ - #define isBUSY(x) (0 < PID_VAL(EU_CPU, s_int, x)) - #define winMIN(a,b) ((a < b) ? a : b) + #define isBUSY(x) (0 < PID_VAL(EU_CPU, s_int, (x))) + #define winMIN(a,b) (((a) < (b)) ? (a) : (b)) int i, lwin; // Display Column Headings -- and distract 'em while we sort (maybe)