public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] Off-by-one in drivers/char/mwave/mwavedd.c
@ 2006-09-26 12:35 Eric Sesterhenn
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn @ 2006-09-26 12:35 UTC (permalink / raw)
  To: linux-kernel

hi,

this fixes two off by ones in the mwave driver, found
via find -iname \*.[ch] | xargs grep "> ARRAY_SIZE("

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.18-git5/drivers/char/mwave/mwavedd.c.orig	2006-09-26 14:32:54.000000000 +0200
+++ linux-2.6.18-git5/drivers/char/mwave/mwavedd.c	2006-09-26 14:34:20.000000000 +0200
@@ -297,7 +297,7 @@ static int mwave_ioctl(struct inode *ino
 				" ipcnum %x, usIntCount %x\n",
 				ipcnum,
 				pDrvData->IPCs[ipcnum].usIntCount);
-			if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) {
+			if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) {
 				PRINTK_ERROR(KERN_ERR_MWAVE
 						"mwavedd::mwave_ioctl:"
 						" IOCTL_MW_GET_IPC: Error:"
@@ -355,7 +355,7 @@ static int mwave_ioctl(struct inode *ino
 				"mwavedd::mwave_ioctl IOCTL_MW_UNREGISTER_IPC"
 				" ipcnum %x\n",
 				ipcnum);
-			if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) {
+			if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) {
 				PRINTK_ERROR(KERN_ERR_MWAVE
 						"mwavedd::mwave_ioctl:"
 						" IOCTL_MW_UNREGISTER_IPC:"



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-26 12:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-26 12:35 [Patch] Off-by-one in drivers/char/mwave/mwavedd.c Eric Sesterhenn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox