From: Vitaly Kuzmichev Date: Fri, 13 Aug 2010 13:00:45 +0000 (+0400) Subject: USB-CDC: Replace 'strcpy' by 'strlcpy' X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=2e12abe65410bcfa4c6058a8b81231d5d62a323c;p=u-boot.git USB-CDC: Replace 'strcpy' by 'strlcpy' Replace 'strcpy' by more safe 'strlcpy' that is implemented in ether.c Signed-off-by: Vitaly Kuzmichev --- diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 51f50060a0..283049ebe6 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -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 */