Skip to content

Commit

Permalink
[PATCH] coverity: ipmi: avoid overrun of ipmi_interfaces[]
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zaur Kambarov authored and Linus Torvalds committed Jun 22, 2005
1 parent 7f20b6a commit 3a84509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/ipmi/ipmi_msghandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ int ipmi_create_user(unsigned int if_num,
return -ENOMEM;

down_read(&interfaces_sem);
if ((if_num > MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL)
if ((if_num >= MAX_IPMI_INTERFACES) || ipmi_interfaces[if_num] == NULL)
{
rv = -EINVAL;
goto out_unlock;
Expand Down

0 comments on commit 3a84509

Please sign in to comment.