USB-CDC: Replace 'strcpy' by 'strlcpy'
authorVitaly Kuzmichev <vkuzmichev@mvista.com>
Fri, 13 Aug 2010 13:00:45 +0000 (17:00 +0400)
committerRemy Bohmer <linux@bohmer.net>
Mon, 20 Sep 2010 19:57:17 +0000 (21:57 +0200)
Replace 'strcpy' by more safe 'strlcpy' that is implemented in ether.c

Signed-off-by: Vitaly Kuzmichev <vkuzmichev@mvista.com>
drivers/usb/gadget/ether.c

index 51f50060a0ea6ffd8a9619b5c7526f7c6497fbb5..283049ebe620590f0c7cd69cc52dc4a4524fc9a9 100644 (file)
@@ -1588,12 +1588,12 @@ static int eth_bind(struct usb_gadget *gadget)
        if (bcdDevice)
                device_desc.bcdDevice = cpu_to_le16(bcdDevice);
        if (iManufacturer)
-               strcpy (manufacturer, iManufacturer);
+               strlcpy (manufacturer, iManufacturer, sizeof manufacturer);
        if (iProduct)
-               strcpy (product_desc, iProduct);
+               strlcpy (product_desc, iProduct, sizeof product_desc);
        if (iSerialNumber) {
                device_desc.iSerialNumber = STRING_SERIALNUMBER,
-               strcpy(serial_number, iSerialNumber);
+               strlcpy(serial_number, iSerialNumber, sizeof serial_number);
        }
 
        /* all we really need is bulk IN/OUT */