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 <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Markus Armbruster 2013-01-10 14:33:25 +01:00 committed by Gerd Hoffmann
parent 4663530898
commit 0360784754

View file

@ -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 */