]> granicus.if.org Git - procps-ng/commitdiff
top: Initialize cp in task_show().
authorQualys Security Advisory <qsa@qualys.com>
Thu, 1 Jan 1970 00:00:00 +0000 (00:00 +0000)
committerCraig Small <csmall@enc.com.au>
Fri, 18 May 2018 21:32:34 +0000 (07:32 +1000)
Found no problematic case at the moment, but this is a cheap
just-in-case.

top/top.c

index 01978e76c955124552e743787e278aaaaf0ec64e..de58d65565d0220430c915940de5765c939956f7 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -5667,7 +5667,7 @@ static const char *task_show (const WIN_t *q, const proc_t *p) {
    if (Rc.mode_altscr) rp = scat(rp, " ");
 
    for (x = 0; x < q->maxpflgs; x++) {
-      const char *cp;
+      const char *cp = NULL;
       FLG_t       i = q->procflgs[x];
       #define S   Fieldstab[i].scale        // these used to be variables
       #define W   Fieldstab[i].width        // but it's much better if we