Skip to content

Commit

Permalink
V4L/DVB: omap24xxcam: potential buffer overflow
Browse files Browse the repository at this point in the history
The previous loop goes until last == VIDEO_MAX_FRAME, so this could
potentially go one past the end of the loop.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Dan Carpenter authored and Mauro Carvalho Chehab committed May 6, 2010
1 parent 722154e commit 2132def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/omap24xxcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ static int omap24xxcam_mmap_buffers(struct file *file,
}

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]);

for (j = 0; j < dma->sglen; j++) {
Expand Down

0 comments on commit 2132def

Please sign in to comment.