提交 13071f0a 编写于 作者: A Alexey Dobriyan 提交者: Mauro Carvalho Chehab

V4L/DVB (5076): Cpia.c: buffer overflow

If assigned minor is 10 or greater, terminator will be put beyound the end.
Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 c74e0062
......@@ -1350,13 +1350,13 @@ static int cpia_write_proc(struct file *file, const char __user *buf,
static void create_proc_cpia_cam(struct cam_data *cam)
{
char name[7];
char name[5 + 1 + 10 + 1];
struct proc_dir_entry *ent;
if (!cpia_proc_root || !cam)
return;
sprintf(name, "video%d", cam->vdev.minor);
snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
if (!ent)
......@@ -1376,12 +1376,12 @@ static void create_proc_cpia_cam(struct cam_data *cam)
static void destroy_proc_cpia_cam(struct cam_data *cam)
{
char name[7];
char name[5 + 1 + 10 + 1];
if (!cam || !cam->proc_entry)
return;
sprintf(name, "video%d", cam->vdev.minor);
snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
remove_proc_entry(name, cpia_proc_root);
cam->proc_entry = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册