* [PATCH] platform/x86: huawei-wmi: Fix a precision vs width printf bug
@ 2019-10-14 10:58 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2019-10-14 10:58 UTC (permalink / raw)
To: Darren Hart, Ayman Bagabas
Cc: Andy Shevchenko, Mattias Jacobsson, Takashi Iwai,
platform-driver-x86, linux-kernel, kernel-janitors
This was supposed to be precision "%.*s" instead of width "%*s". It's
possible that this results in printing beyond the end of the string.
Fixes: a970b95345ab ("platform/x86: huawei-wmi: Add debugfs support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/platform/x86/huawei-wmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 6720f78c60c2..69a7be8dafcd 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -612,7 +612,7 @@ static void huawei_wmi_debugfs_call_dump(struct seq_file *m, void *data,
seq_printf(m, "0x%llx", obj->integer.value);
break;
case ACPI_TYPE_STRING:
- seq_printf(m, "\"%*s\"", obj->string.length, obj->string.pointer);
+ seq_printf(m, "\"%.*s\"", obj->string.length, obj->string.pointer);
break;
case ACPI_TYPE_BUFFER:
seq_puts(m, "{");
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-10-14 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 10:58 [PATCH] platform/x86: huawei-wmi: Fix a precision vs width printf bug Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).