diff options
author | Zaur Kambarov <kambarov@berkeley.edu> | 2005-06-21 20:14:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 21:46:11 -0400 |
commit | 3a845099b20e81fb678521f034bbdcd69208da4e (patch) | |
tree | 99f3a8259c54616a1a0fd30f25e34927c36c3eff /drivers/char | |
parent | 7f20b6a4792c1b5033583c23b5594887dd3867b9 (diff) |
[PATCH] coverity: ipmi: avoid overrun of ipmi_interfaces[]
Fix overrun of static array "ipmi_interfaces" of size 4 at position 4 with
index variable "if_num".
Definitions involved:
297 #define MAX_IPMI_INTERFACES 4
298 static ipmi_smi_t ipmi_interfaces[MAX_IPMI_INTERFACES];
Signed-off-by: Zaur Kambarov <zkambarov@coverity.com>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index d7fb452af7f9..0c81652eaba6 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
@@ -641,7 +641,7 @@ int ipmi_create_user(unsigned int if_num, | |||
641 | return -ENOMEM; | 641 | return -ENOMEM; |
642 | 642 | ||
643 | down_read(&interfaces_sem); | 643 | down_read(&interfaces_sem); |
644 | if ((if_num > MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL) | 644 | if ((if_num >= MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL) |
645 | { | 645 | { |
646 | rv = -EINVAL; | 646 | rv = -EINVAL; |
647 | goto out_unlock; | 647 | goto out_unlock; |