aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2011-12-16 13:06:31 -0600
committerJens Axboe <jaxboe@fusionio.com>2012-02-01 13:14:26 +0100
commit729b2bf689624646a3a9ce9a8f0dbec3eae02004 (patch)
treeef06f20cf4143cabd532950ae38e99e7164b0580
parentae2dc05e9084c790e773f530cefb9a1df1d51f0a (diff)
downloadblktrace-729b2bf689624646a3a9ce9a8f0dbec3eae02004.tar.gz
Fix potential array overrun in act_to_str
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> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--blkrawverify.c2
1 files changed, 1 insertions, 1 deletions
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)) {