diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-22 19:45:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:36 -0400 |
commit | 4245c0256da0784b1f96d01ff263a71a4ca3894e (patch) | |
tree | 7e84f605109504cbabab3ac7f36e0ffc4949b13e /drivers | |
parent | e9510176ff728135383f0cdfc9c90cfe57f9e162 (diff) |
sdio: fix read buffer overflow
Avoid buffer underrun when parsing an invalid CISTPL_VERS_1.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Cc: David Vrabel <david.vrabel@csr.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/core/sdio_cis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/sdio_cis.c b/drivers/mmc/core/sdio_cis.c index 963f2937c5e3..6636354b48ce 100644 --- a/drivers/mmc/core/sdio_cis.c +++ b/drivers/mmc/core/sdio_cis.c | |||
@@ -40,7 +40,7 @@ static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func, | |||
40 | nr_strings++; | 40 | nr_strings++; |
41 | } | 41 | } |
42 | 42 | ||
43 | if (buf[i-1] != '\0') { | 43 | if (nr_strings < 4) { |
44 | printk(KERN_WARNING "SDIO: ignoring broken CISTPL_VERS_1\n"); | 44 | printk(KERN_WARNING "SDIO: ignoring broken CISTPL_VERS_1\n"); |
45 | return 0; | 45 | return 0; |
46 | } | 46 | } |