From b59332f8aa23637128b59dbdaf0cb1129fde280b Mon Sep 17 00:00:00 2001 From: pfg Date: Sat, 31 Jan 2015 15:41:01 +0000 Subject: Prevent access to an uninitialized variable The "-h" option may access an uninitialized value. Prevent it by properly initializing the value. CID: 1006559 --- bin/ps/ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/ps') 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; -- cgit v1.1