Skip to content

Commit

Permalink
[PATCH] fix array overrun in drivers/char/mwave/mwavedd.c
Browse files Browse the repository at this point in the history
this fixes coverity id #489.

Since the last element in the array is always ARRAY_SIZE-1 we have to check
for ipcnum >= ARRAY_SIZE()

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Eric Sesterhenn authored and Linus Torvalds committed Apr 28, 2006
1 parent 1ac3836 commit d698f1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/mwave/mwavedd.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
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_REGISTER_IPC:"
Expand Down

0 comments on commit d698f1c

Please sign in to comment.