Skip to content

Commit

Permalink
V4L/DVB (13414): ttusb-dec: do not overwrite the first part of phys s…
Browse files Browse the repository at this point in the history
…tring

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: Márton Németh <nm127@freemail.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Márton Németh authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent cd0e280 commit b185819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb/ttusb-dec/ttusb_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b185819

Please sign in to comment.