From 3352bddba5827e65dbb05f4cc86b6dc089770215 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Fri, 1 Jun 2018 00:00:00 -0500 Subject: [PATCH] library: tweak that change to 'supgrps_from_supgids()' It's good that those Qualys folks were looking over my shoulder. They suggested a change to that commit shown below. This improvement was obviously a better choice. Reference(s): . original change commit f9a8009e27d47a61096ff7bf1de37a90f0f801e6 Signed-off-by: Jim Warner --- proc/readproc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/proc/readproc.c b/proc/readproc.c index ea7a31bb..a6666cbc 100644 --- a/proc/readproc.c +++ b/proc/readproc.c @@ -475,11 +475,7 @@ static void supgrps_from_supgids (proc_t *p) { while (',' == *s) ++s; gid = strtol(s, &end, 10); - if (end <= s) { - if (!p->supgrp) - p->supgrp = xstrdup("-"); - break; - } + if (end <= s) break; s = end; g = pwcache_get_group(gid); @@ -491,6 +487,9 @@ static void supgrps_from_supgids (proc_t *p) { else if (len >= max) len = max-1; t += len; } while (*s); + + if (!p->supgrp) + p->supgrp = xstrdup("-"); } /////////////////////////////////////////////////////////////////////// -- 2.40.0