* [PATCH BlueZ v1] rctest: replace sprintf() with snprintf() in recv_mode()
@ 2024-06-28 13:15 Roman Smirnov
2024-06-28 15:04 ` [BlueZ,v1] " bluez.test.bot
2024-06-28 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-06-28 13:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Roman Smirnov
Use snprintf() instead of sprintf() to avoid buffer overflow.
Found with the SVACE static analysis tool.
---
tools/rctest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/rctest.c b/tools/rctest.c
index ff91eb2f1..e39d313eb 100644
--- a/tools/rctest.c
+++ b/tools/rctest.c
@@ -500,7 +500,7 @@ static void recv_mode(int sk)
timestamp = 0;
memset(ts, 0, sizeof(ts));
} else {
- sprintf(ts, "[%lld.%lld] ",
+ snprintf(ts, sizeof(ts), "[%lld.%lld] ",
(long long)tv.tv_sec,
(long long)tv.tv_usec);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [BlueZ,v1] rctest: replace sprintf() with snprintf() in recv_mode()
2024-06-28 13:15 [PATCH BlueZ v1] rctest: replace sprintf() with snprintf() in recv_mode() Roman Smirnov
@ 2024-06-28 15:04 ` bluez.test.bot
2024-06-28 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-06-28 15:04 UTC (permalink / raw)
To: linux-bluetooth, r.smirnov
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=866591
---Test result---
Test Summary:
CheckPatch PASS 0.45 seconds
GitLint PASS 0.32 seconds
BuildEll PASS 24.95 seconds
BluezMake PASS 1760.44 seconds
MakeCheck PASS 13.72 seconds
MakeDistcheck PASS 181.46 seconds
CheckValgrind PASS 255.22 seconds
CheckSmatch WARNING 358.53 seconds
bluezmakeextell PASS 121.47 seconds
IncrementalBuild PASS 1520.73 seconds
ScanBuild PASS 1023.90 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
tools/rctest.c:625:33: warning: non-ANSI function declaration of function 'automated_send_recv'
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ v1] rctest: replace sprintf() with snprintf() in recv_mode()
2024-06-28 13:15 [PATCH BlueZ v1] rctest: replace sprintf() with snprintf() in recv_mode() Roman Smirnov
2024-06-28 15:04 ` [BlueZ,v1] " bluez.test.bot
@ 2024-06-28 15:10 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-06-28 15:10 UTC (permalink / raw)
To: Roman Smirnov; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 28 Jun 2024 16:15:30 +0300 you wrote:
> Use snprintf() instead of sprintf() to avoid buffer overflow.
>
> Found with the SVACE static analysis tool.
> ---
> tools/rctest.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [BlueZ,v1] rctest: replace sprintf() with snprintf() in recv_mode()
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=559e40a8b9a4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-28 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28 13:15 [PATCH BlueZ v1] rctest: replace sprintf() with snprintf() in recv_mode() Roman Smirnov
2024-06-28 15:04 ` [BlueZ,v1] " bluez.test.bot
2024-06-28 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox