[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/6] usb-host: Initialize dev->port the obviously sa
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 6/6] usb-host: Initialize dev->port the obviously safe way |
Date: |
Mon, 14 Jan 2013 12:50:19 +0100 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/host-linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c
index a498840..ad75ce0 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 */
--
1.7.9.7
- [Qemu-devel] [PULL 0/6] usb patch queue, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 3/6] xhci: nuke transfe5rs on detach, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 1/6] xhci: create xhci_detach_slot helper function, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 5/6] usb-host: Drop superfluous null test from usb_host_auto_scan(), Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 6/6] usb-host: Initialize dev->port the obviously safe way,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 4/6] ehci: Assert state machine is sane w.r.t. EHCIQueue, Gerd Hoffmann, 2013/01/14
- [Qemu-devel] [PATCH 2/6] xhci: call xhci_detach_slot on root port detach too, Gerd Hoffmann, 2013/01/14
- Re: [Qemu-devel] [PULL 0/6] usb patch queue, Anthony Liguori, 2013/01/14