]> granicus.if.org Git - procps-ng/commitdiff
library: oldproc_open has always yes check
authorCraig Small <csmall@dropbear.xyz>
Sat, 14 May 2016 12:55:16 +0000 (22:55 +1000)
committerCraig Small <csmall@dropbear.xyz>
Sat, 14 May 2016 12:55:16 +0000 (22:55 +1000)
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 <csmall@dropbear.xyz>
proc/pids.c

index cc3a4ac91d5756c8efad1a24a207e308c66ae560..b7a88ebf53d4fefbecac0f8b37d1f535105dbfbf 100644 (file)
@@ -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;