提交 d698f1c7 编写于 作者: E Eric Sesterhenn 提交者: Linus Torvalds

[PATCH] fix array overrun in drivers/char/mwave/mwavedd.c

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: NEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1ac3836c
...@@ -271,7 +271,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file, ...@@ -271,7 +271,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
ipcnum, ipcnum,
pDrvData->IPCs[ipcnum].usIntCount); pDrvData->IPCs[ipcnum].usIntCount);
if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) { if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) {
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"mwavedd::mwave_ioctl:" "mwavedd::mwave_ioctl:"
" IOCTL_MW_REGISTER_IPC:" " IOCTL_MW_REGISTER_IPC:"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册