SHA256
1
0
forked from pool/qemu
qemu/0037-hw-usb-hcd-xhci-Fix-GCC-9-build-war.patch
Bruce Rogers 0638b75726 Accepting request 702352 from home:bfrogers:branches:Virtualization
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
* Patches renamed:
  0036-util-qemu-sockets-Fix-GCC-9-build-w.patch
  -> 0036-sockets-avoid-string-truncation-war.patch
  0039-linux-user-uname-Fix-GCC-9-build-wa.patch
  -> 0039-linux-user-avoid-string-truncation-.patch
- Correct logic of which ipxe patches get included based on
  suse_version. We were wrongly excluding a gcc9 related patch for
  example
- Switch to now upstreamed version of some patches
* Patches renamed:
  0036-util-qemu-sockets-Fix-GCC-9-build-w.patch
  -> 0036-sockets-avoid-string-truncation-war.patch
  0039-linux-user-uname-Fix-GCC-9-build-wa.patch
  -> 0039-linux-user-avoid-string-truncation-.patch
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
- Create /usr/share/qemu/firmware and /etc/qemu/firmware directories
  in support of the firmware descriptor feature now in use as of
  libvirt v5.2
- Correct logic of which ipxe patches get included based on
  suse_version. We were wrongly excluding a gcc9 related patch for
  example
- Switch to now upstreamed version of some patches
* Patches renamed:
  0036-util-qemu-sockets-Fix-GCC-9-build-w.patch
  -> 0036-sockets-avoid-string-truncation-war.patch
  0039-linux-user-uname-Fix-GCC-9-build-wa.patch
  -> 0039-linux-user-avoid-string-truncation-.patch
- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.0
- Create /usr/share/qemu/firmware and /etc/qemu/firmware directories
  in support of the firmware descriptor feature now in use as of
  libvirt v5.2

OBS-URL: https://build.opensuse.org/request/show/702352
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=468
2019-05-11 15:08:13 +00:00

39 lines
1.9 KiB
Diff

From: Alistair Francis <Alistair.Francis@wdc.com>
Date: Sat, 4 May 2019 07:58:35 -0600
Subject: hw/usb/hcd-xhci: Fix GCC 9 build warning
Fix this build warning with GCC 9 on Fedora 30:
hw/usb/hcd-xhci.c:3339:66: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Werror=format-truncation=]
3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1);
| ^~
hw/usb/hcd-xhci.c:3339:54: note: directive argument in the range [1, 2147483647]
3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1);
| ^~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from /home/alistair/qemu/include/qemu/osdep.h:99,
from hw/usb/hcd-xhci.c:21:
/usr/include/bits/stdio2.h:67:10: note: '__builtin___snprintf_chk' output between 13 and 22 bytes into a destination of size 16
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
hw/usb/hcd-xhci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index ec28bee319..2b061772b2 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3322,6 +3322,7 @@ static void usb_xhci_init(XHCIState *xhci)
usb_bus_new(&xhci->bus, sizeof(xhci->bus), &xhci_bus_ops, dev);
for (i = 0; i < usbports; i++) {
+ g_assert(i < MAX(MAXPORTS_2, MAXPORTS_3));
speedmask = 0;
if (i < xhci->numports_2) {
if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) {