pcnet32: Read buffer overflow
authorroel kluin <roel.kluin@gmail.com>
Fri, 7 Aug 2009 03:24:27 +0000 (03:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Aug 2009 04:45:48 +0000 (21:45 -0700)
An `options[cards_found]' that equals `sizeof(options_mapping)' is already beyond
the array.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcnet32.c

index a646a445fda94a3eb250a7a09a1f063f55c2f9e7..23e1a0750fe0eba518dc87b1bfbbef7e4cf8283b 100644 (file)
@@ -1839,7 +1839,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
        lp->chip_version = chip_version;
        lp->msg_enable = pcnet32_debug;
        if ((cards_found >= MAX_UNITS)
-           || (options[cards_found] > sizeof(options_mapping)))
+           || (options[cards_found] >= sizeof(options_mapping)))
                lp->options = PCNET32_PORT_ASEL;
        else
                lp->options = options_mapping[options[cards_found]];