[<prev] [next>] [day] [month] [year] [list]
Message-ID: <DB6P189MB05680D444447A5565282D0C89CE5A@DB6P189MB0568.EURP189.PROD.OUTLOOK.COM>
Date: Thu, 31 Aug 2023 10:53:14 +0000
From: David Binderman <dcb314@...mail.com>
To: "bristot@...nel.org" <bristot@...nel.org>,
"rostedt@...dmis.org" <rostedt@...dmis.org>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"palmer@...belt.com" <palmer@...belt.com>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"linux-trace-kernel@...r.kernel.org"
<linux-trace-kernel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>
Subject: linux-6.5/tools/tracing/rtla/src/utils.c:548:invalidScanfFormatWidth
Hello there,
I just tried the static analyser cppcheck over the source code of linux-6.5
and got this:
linux-6.5/tools/tracing/rtla/src/utils.c:548:9: error: Width 1024 given in format string (no. 1) is larger than destination buffer 'mount_point[1024]', use %1023s to prevent overflowing it. [invalidScanfFormatWidth]
Source code is
while (fscanf(fp, "%*s %" STR(MAX_PATH) "s %99s %*s %*d %*d\n", mount_point, type) == 2) {
Maybe better code:
while (fscanf(fp, "%*s %" STR(MAX_PATH - 1) "s %99s %*s %*d %*d\n", mount_point, type) == 2) {
Regards
David Binderman
Powered by blists - more mailing lists