patch-2.1.121 linux/drivers/char/bttv.c

Next file: linux/drivers/char/cyclades.c
Previous file: linux/drivers/cdrom/cdrom.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.120/linux/drivers/char/bttv.c linux/drivers/char/bttv.c
@@ -1801,6 +1801,9 @@
 	        case VIDIOCSYNC:
 			if(copy_from_user((void *)&i,arg,sizeof(int)))
 				return -EFAULT;
+                        if(i>1 || i<0)
+                                return -EINVAL;
+
                         switch (btv->frame_stat[i]) {
                         case GBUFFER_UNUSED:
                                 return -EINVAL;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov