patch-2.4.21 linux-2.4.21/drivers/media/video/zoran_procfs.c

Next file: linux-2.4.21/drivers/media/video/zr36120.c
Previous file: linux-2.4.21/drivers/media/video/w9966.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/media/video/zoran_procfs.c linux-2.4.21/drivers/media/video/zoran_procfs.c
@@ -119,7 +119,11 @@
 		printk(KERN_ERR "%s: write_proc: can not allocate memory\n", zr->name);
 		return -ENOMEM;
 	}
-	memcpy(string, buffer, count);
+	if(copy_from_user(string, buffer, count))
+	{
+		vfree(string);
+		return -EFAULT;
+	}
 	string[count] = 0;
 	DEBUG2(printk(KERN_INFO "%s: write_proc: name=%s count=%lu data=%x\n", zr->name, file->f_dentry->d_name.name, count, (int) data));
 	ldelim = " \t\n";

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)