lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B081954.5020907@freemail.hu>
Date:	Sat, 21 Nov 2009 17:46:12 +0100
From:	Németh Márton <nm127@...email.hu>
To:	Mauro Carvalho Chehab <mchehab@...radead.org>,
	v4L Mailing List <linux-media@...r.kernel.org>
CC:	cocci@...u.dk, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] dvb ttusb-dec: do not overwrite the first part of phys string

From: Márton Németh <nm127@...email.hu>

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@...email.hu>
---
diff -u -p a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-09-10 00:13:59.000000000 +0200
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-11-21 17:30:10.000000000 +0100
@@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_d
 	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)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ