Commit 03607847 authored by Markus Armbruster's avatar Markus Armbruster Committed by Gerd Hoffmann
Browse files

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: default avatarMarkus Armbruster <armbru@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 46635308
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */