lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20191014105801.GA31759@mwanda>
Date:   Mon, 14 Oct 2019 13:58:01 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Darren Hart <dvhart@...radead.org>,
        Ayman Bagabas <ayman.bagabas@...il.com>
Cc:     Andy Shevchenko <andy@...radead.org>,
        Mattias Jacobsson <2pi@....nu>, Takashi Iwai <tiwai@...e.de>,
        platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: [PATCH] platform/x86: huawei-wmi: Fix a precision vs width printf bug

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@...cle.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ