From 729b2bf689624646a3a9ce9a8f0dbec3eae02004 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Fri, 16 Dec 2011 13:06:31 -0600 Subject: 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 Signed-off-by: Jens Axboe --- blkrawverify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) { -- cgit v1.2.3