From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7555277246377902798==" MIME-Version: 1.0 From: Chris Ferron Subject: Re: [Powertop] [PATCH] prevent jump on uninitialized value Date: Wed, 27 Jun 2012 11:20:00 -0700 Message-ID: <4FEB4ED0.2090303@linux.intel.com> In-Reply-To: 20120627081714.GC2996@swordfish.datadirect.datadirectnet.com To: powertop@lists.01.org List-ID: --===============7555277246377902798== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable patch applied Thanks -C On 06/27/2012 01:17 AM, Sergey Senozhatsky wrote: > workload is getting 'initialized' with stack garbage, > so later conditional check of !workload[0] in report() > is invalid. > > Signed-off-by: Sergey Senozhatsky > > --- > > src/main.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/main.cpp b/src/main.cpp > index d8e2a47..7a1b976 100644 > --- a/src/main.cpp > +++ b/src/main.cpp > @@ -356,7 +356,7 @@ int main(int argc, char **argv) > int c; > bool wantreport =3D FALSE; > char filename[4096]; > - char workload[4096]; > + char workload[4096] =3D {0,}; > int iterations =3D 1; > = > #ifndef DISABLE_TRYCATCH > --===============7555277246377902798==--