提交 2132deff 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

V4L/DVB: omap24xxcam: potential buffer overflow

The previous loop goes until last == VIDEO_MAX_FRAME, so this could
potentially go one past the end of the loop.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Acked-by: NSakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 722154e4
...@@ -1405,7 +1405,7 @@ static int omap24xxcam_mmap_buffers(struct file *file, ...@@ -1405,7 +1405,7 @@ static int omap24xxcam_mmap_buffers(struct file *file,
} }
size = 0; size = 0;
for (i = first; i <= last; i++) { for (i = first; i <= last && i < VIDEO_MAX_FRAME; i++) {
struct videobuf_dmabuf *dma = videobuf_to_dma(vbq->bufs[i]); struct videobuf_dmabuf *dma = videobuf_to_dma(vbq->bufs[i]);
for (j = 0; j < dma->sglen; j++) { for (j = 0; j < dma->sglen; j++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册