[Patch] Overrun in cdrom/aztcd.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

this fixes coverity bug id #473.
After the for loop i==16 if we dont find a cdrom. So we should
check for i==16 first before checking the array element.

Signed-off-by: Eric Sesterhenn <[email protected]>

--- linux-2.6.17-rc1/drivers/cdrom/aztcd.c.orig	2006-04-09 19:09:24.000000000 +0200
+++ linux-2.6.17-rc1/drivers/cdrom/aztcd.c	2006-04-09 19:09:49.000000000 +0200
@@ -1763,7 +1763,7 @@ static int __init aztcd_init(void)
 				release_region(azt_port, 4);
 			}
 		}
-		if ((azt_port_auto[i] == 0) || (i == 16)) {
+		if ((i == 16) || (azt_port_auto[i] == 0)) {
 			printk(KERN_INFO "aztcd: no AZTECH CD-ROM drive found\n");
 			return -EIO;
 		}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux