Skip to content

Commit

Permalink
eepro: Read buffer overflow
Browse files Browse the repository at this point in the history
io[i] is read before the bounds check on i, order should be reversed

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roel Kluin authored and David S. Miller committed Jul 27, 2009
1 parent c65d319 commit d513d01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/eepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ int __init init_module(void)
printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n");
}

for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) {
for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) {
dev = alloc_etherdev(sizeof(struct eepro_local));
if (!dev)
break;
Expand Down

0 comments on commit d513d01

Please sign in to comment.