From: roel kluin Date: Fri, 7 Aug 2009 03:24:27 +0000 (+0000) Subject: pcnet32: Read buffer overflow X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5e33b719c8fcccfedc1d25167826a0f93fe6c5a1;p=openwrt%2Fstaging%2Fblogic.git pcnet32: Read buffer overflow An `options[cards_found]' that equals `sizeof(options_mapping)' is already beyond the array. Signed-off-by: Roel Kluin Signed-off-by: David S. Miller --- diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index a646a445fda9..23e1a0750fe0 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c @@ -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]];