From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIGC-0001BK-I6 for qemu-devel@nongnu.org; Thu, 10 Jan 2013 08:33:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtIGA-0002CN-Eq for qemu-devel@nongnu.org; Thu, 10 Jan 2013 08:33:32 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:47365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtIGA-0002Bu-4f for qemu-devel@nongnu.org; Thu, 10 Jan 2013 08:33:30 -0500 Received: from blackfin.pond.sub.org (p5B32A660.dip.t-dialin.net [91.50.166.96]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 2E7789FE6B for ; Thu, 10 Jan 2013 14:33:26 +0100 (CET) From: Markus Armbruster Date: Thu, 10 Jan 2013 14:33:25 +0100 Message-Id: <1357824805-31574-4-git-send-email-armbru@redhat.com> In-Reply-To: <1357824805-31574-1-git-send-email-armbru@redhat.com> References: <1357824805-31574-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] usb-host: Initialize dev->port the obviously safe way List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com 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 --- 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 ea2179f..fc7c5ca 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.11.7