From: Eric Sandeen <sandeen@redhat.com>
To: linux-btrace@vger.kernel.org
Subject: [PATCH 2/10] Fix potential array overrun in act_to_str
Date: Fri, 16 Dec 2011 19:06:31 +0000 [thread overview]
Message-ID: <4EEB96B7.1020902@redhat.com> (raw)
The acts[] array is only N_ACTS elements, so we should not
ever set acts[N_ACTS]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/blkrawverify.c b/blkrawverify.c
index b6ceb9d..4638eb7 100644
--- a/blkrawverify.c
+++ b/blkrawverify.c
@@ -87,7 +87,7 @@ static char *act_to_str(__u32 action)
unsigned int act = action & 0xffff;
unsigned int trace = (action >> BLK_TC_SHIFT) & 0xffff;
- if (act <= N_ACTS) {
+ if (act < N_ACTS) {
sprintf(buf, "%s ", acts[act].string);
for (i = 0; i < N_TRACES; i++)
if (trace & (1 << i)) {
reply other threads:[~2011-12-16 19:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4EEB96B7.1020902@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-btrace@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).