Re: [PATCH] usbvideo: limit the length of string creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 21 November 2009 18:02:56 Németh Márton wrote:
> From: Márton Németh <nm127@xxxxxxxxxxx>
> 
> Use strlcat() to append a string to the previously created first part.
> The strlcat() function limits the size of the string to the whole
> destination buffer.
> 
> 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);
> -	strncat(phys, str, size);
> +	strlcat(phys, str, size);
> // </smpl>
> 
> Signed-off-by: Márton Németh <nm127@xxxxxxxxxxx>

Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux