From: Sergey Senozhatsky <sergey.senozhatsky at gmail.com>
To: powertop@lists.01.org
Subject: [Powertop] [PATCH] prevent jump on uninitialized value
Date: Wed, 27 Jun 2012 11:17:14 +0300 [thread overview]
Message-ID: <20120627081714.GC2996@swordfish.datadirect.datadirectnet.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 614 bytes --]
workload is getting 'initialized' with stack garbage,
so later conditional check of !workload[0] in report()
is invalid.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com>
---
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 = FALSE;
char filename[4096];
- char workload[4096];
+ char workload[4096] = {0,};
int iterations = 1;
#ifndef DISABLE_TRYCATCH
next reply other threads:[~2012-06-27 8:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 8:17 Sergey Senozhatsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-27 18:20 [Powertop] [PATCH] prevent jump on uninitialized value Chris Ferron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120627081714.GC2996@swordfish.datadirect.datadirectnet.com \
--to=powertop@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.