summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-01-31 15:41:01 +0000
committerpfg <pfg@FreeBSD.org>2015-01-31 15:41:01 +0000
commitb59332f8aa23637128b59dbdaf0cb1129fde280b (patch)
treedf698925fa0b78b32eb6894aa9fc1371c4764866 /bin/ps
parent9fb7956fcabb654e35502323111b313875173304 (diff)
downloadFreeBSD-src-b59332f8aa23637128b59dbdaf0cb1129fde280b.zip
FreeBSD-src-b59332f8aa23637128b59dbdaf0cb1129fde280b.tar.gz
Prevent access to an uninitialized variable
The "-h" option may access an uninitialized value. Prevent it by properly initializing the value. CID: 1006559
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 9d14a72c..449367c 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -178,7 +178,7 @@ main(int argc, char *argv[])
KINFO *kinfo = NULL, *next_KINFO;
KINFO_STR *ks;
struct varent *vent;
- struct winsize ws;
+ struct winsize ws = { .ws_row = 0 };
const char *nlistf, *memf, *fmtstr, *str;
char *cols;
int all, ch, elem, flag, _fmt, i, lineno, linelen, left;
OpenPOWER on IntegriCloud