SHA256
1
0
forked from pool/qemu
qemu/hdata-vpd-fix-printing-char-0x00.patch
Bruce Rogers 0f796dd004 Accepting request 730437 from Virtualization:Staging
Update to v4.1.0. Also includes other major packaging changes as follows:
There is a new package maintenance workflow - see README.PACKAGING for details.
The sibling packages qemu-linux-user and qemu-testsuite are now created with the Build Service's MultiBuild feature. This also necessitates combining the qemu-linux-user changelog content back into qemu's. Luckily the delta there is quite small. Note that the qemu spec file is now that much busier, but added section markers should help reduce the confusion. Also qemu is being enabled for RISCV host compatibility, so some changes are related to that as well.

OBS-URL: https://build.opensuse.org/request/show/730437
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=487
2019-09-12 15:54:03 +00:00

65 lines
2.2 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From: Stewart Smith <stewart@linux.ibm.com>
Date: Tue, 18 Jun 2019 16:06:44 +1000
Subject: hdata/vpd: fix printing (char*)0x00
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: ba977f2e4406f9de318afcdf5d666e77585ef269
GCC9 now catches this bug:
In file included from hdata/vpd.c:17:
In function vpd_vini_parse,
inlined from vpd_data_parse at hdata/vpd.c:416:3:
/home/stewart/skiboot/include/skiboot.h:93:31: error: %s directive argument is null [-Werror=format-overflow=]
93 | #define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hdata/vpd.c:390:5: note: in expansion of macro prlog
390 | prlog(PR_WARNING,
| ^~~~~
hdata/vpd.c: In function vpd_data_parse:
hdata/vpd.c:391:46: note: format string is defined here
391 | "VPD: CCIN desc not available for: %s\n",
| ^~
cc1: all warnings being treated as errors
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
hdata/vpd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/roms/skiboot/hdata/vpd.c b/roms/skiboot/hdata/vpd.c
index 129b5062356a48d900c6aa5a140d..5a01bcc9f6fa2faef2a118eca938 100644
--- a/roms/skiboot/hdata/vpd.c
+++ b/roms/skiboot/hdata/vpd.c
@@ -328,6 +328,7 @@ static void vpd_vini_parse(struct dt_node *node,
const void *fruvpd, unsigned int fruvpd_sz)
{
const void *kw;
+ const char *desc;
uint8_t sz;
const struct card_info *cinfo;
@@ -381,15 +382,15 @@ static void vpd_vini_parse(struct dt_node *node,
dt_add_property_string(node,
"description", cinfo->description);
} else {
- kw = vpd_find(fruvpd, fruvpd_sz, "VINI", "DR", &sz);
- if (kw) {
+ desc = vpd_find(fruvpd, fruvpd_sz, "VINI", "DR", &sz);
+ if (desc) {
dt_add_prop_sanitize_val(node,
- "description", kw, sz);
+ "description", desc, sz);
} else {
dt_add_property_string(node, "description", "Unknown");
prlog(PR_WARNING,
"VPD: CCIN desc not available for: %s\n",
- (char *)kw);
+ (char*)kw);
}
}
}