提交 03607847 编写于 作者: M Markus Armbruster 提交者: Gerd Hoffmann

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: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 46635308
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册