summaryrefslogtreecommitdiffstats
path: root/hw/usb
diff options
context:
space:
mode:
authorMarkus Armbruster2013-01-10 14:33:25 +0100
committerGerd Hoffmann2013-01-14 12:47:11 +0100
commit036078475427f2562c8e505f6bb44dbf5d8cbd95 (patch)
tree2b2e2e408eec07b462f0f64b872a2dc29c6f3566 /hw/usb
parentusb-host: Drop superfluous null test from usb_host_auto_scan() (diff)
downloadqemu-036078475427f2562c8e505f6bb44dbf5d8cbd95.tar.gz
qemu-036078475427f2562c8e505f6bb44dbf5d8cbd95.tar.xz
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')
-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 */