From 484f578134f8f0e87706ad7e92445a8b208daa6d Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Sat, 31 Jan 2015 15:41:01 +0000 Subject: [PATCH] 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(-) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 9d14a72c9a60..449367cd4f1b 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;