From: Craig Small Date: Sat, 14 May 2016 12:55:16 +0000 (+1000) Subject: library: oldproc_open has always yes check X-Git-Tag: v4.0.0~904 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfb7361980977c586980b9de9ff0e0ef5ddb51f0;p=procps-ng library: oldproc_open has always yes check if (info->flags | PROC_UID) Something OR a non-zero constant is always true. Looks like it should be and'ed for the standard flag masking pattern. References: Coverity #99118 Signed-off-by: Craig Small --- diff --git a/proc/pids.c b/proc/pids.c index cc3a4ac9..b7a88ebf 100644 --- a/proc/pids.c +++ b/proc/pids.c @@ -977,7 +977,7 @@ static inline int oldproc_open ( if (info->PT == NULL) { va_start(vl, supp_flgs); ids = va_arg(vl, int*); - if (info->flags | PROC_UID) num = va_arg(vl, int); + if (info->flags & PROC_UID) num = va_arg(vl, int); va_end(vl); if (NULL == (info->PT = openproc(info->flags | supp_flgs, ids, num))) return 0;