提交 b1858190 编写于 作者: M Márton Németh 提交者: Mauro Carvalho Chehab

V4L/DVB (13414): ttusb-dec: do not overwrite the first part of phys string

Use strlcat() to append a string to the previously created first part.

The semantic match that finds this kind of problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression dev;
expression phys;
expression str;
expression size;
@@
 	usb_make_path(dev, phys, size);
-	strlcpy(phys, str, size);
+	strlcat(phys, str, size);
// </smpl>
Signed-off-by: NMárton Németh <nm127@freemail.hu>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 cd0e280f
......@@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
int err;
usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
strlcpy(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
input_dev = input_allocate_device();
if (!input_dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册