From: Markus Armbruster Date: Thu, 10 Jan 2013 13:33:25 +0000 (+0100) Subject: usb-host: Initialize dev->port the obviously safe way X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=036078475427f2562c8e505f6bb44dbf5d8cbd95;p=qemu.git usb-host: Initialize dev->port the obviously safe way Coverity worries the strcpy() could overrun the destination. It can't, because the source always points to usb_host_scan()'s auto port[], which has the same size. Use pstrcpy() anyway, to hush the checker. Signed-off-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c index a498840e0a..ad75ce0702 100644 --- a/hw/usb/host-linux.c +++ b/hw/usb/host-linux.c @@ -1314,7 +1314,7 @@ static int usb_host_open(USBHostDevice *dev, int bus_num, dev->bus_num = bus_num; dev->addr = addr; - strcpy(dev->port, port); + pstrcpy(dev->port, sizeof(dev->port), port); dev->fd = fd; /* read the device description */