summary refs log tree commit diff stats
path: root/hw/usb/host-linux.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-10 14:33:25 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-01-14 12:47:11 +0100
commit036078475427f2562c8e505f6bb44dbf5d8cbd95 (patch)
tree2b2e2e408eec07b462f0f64b872a2dc29c6f3566 /hw/usb/host-linux.c
parent4663530898a15944706d51b523d1f1545e32e46a (diff)
downloadfocaccia-qemu-036078475427f2562c8e505f6bb44dbf5d8cbd95.tar.gz
focaccia-qemu-036078475427f2562c8e505f6bb44dbf5d8cbd95.zip
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>
Diffstat (limited to 'hw/usb/host-linux.c')
-rw-r--r--hw/usb/host-linux.c2
1 files changed, 1 insertions, 1 deletions
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 */