projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
929afa7
)
fix out of bound access to mode_strings
author
Stefano Stabellini
<sstabellini@kernel.org>
Fri, 9 Dec 2016 01:17:04 +0000
(17:17 -0800)
committer
Stefano Stabellini
<sstabellini@kernel.org>
Fri, 9 Dec 2016 19:37:33 +0000
(11:37 -0800)
mode == ARRAY_SIZE(mode_strings) causes an out of bound access to
the mode_strings array.
Coverity-ID:
1381859
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/traps.c
patch
|
blob
|
history
diff --git
a/xen/arch/arm/traps.c
b/xen/arch/arm/traps.c
index eb85d92c6d6fa1e9981531b15bcd8025428f4258..35d8e8b09a528afdd8fecc572a0b19d4f6ea36aa 100644
(file)
--- a/
xen/arch/arm/traps.c
+++ b/
xen/arch/arm/traps.c
@@
-643,7
+643,7
@@
static const char *mode_string(uint32_t cpsr)
};
mode = cpsr & PSR_MODE_MASK;
- if ( mode > ARRAY_SIZE(mode_strings) )
+ if ( mode >
=
ARRAY_SIZE(mode_strings) )
return "Unknown";
return mode_strings[mode] ? : "Unknown";
}