* [PATCH 2/10] Fix potential array overrun in act_to_str
@ 2011-12-16 19:06 Eric Sandeen
0 siblings, 0 replies; only message in thread
From: Eric Sandeen @ 2011-12-16 19:06 UTC (permalink / raw)
To: linux-btrace
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)) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-16 19:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 19:06 [PATCH 2/10] Fix potential array overrun in act_to_str Eric Sandeen
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).