diff mbox series

[BlueZ,v1] l2test: replace sprintf() with snprintf() in recv_mode()

Message ID 20240628130142.549979-1-r.smirnov@omp.ru (mailing list archive)
State Accepted
Commit 0bd3d1505e3a9f8b48768411b837dac80b21827e
Headers show
Series [BlueZ,v1] l2test: replace sprintf() with snprintf() in recv_mode() | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Roman Smirnov June 28, 2024, 1:01 p.m. UTC
Use snprintf() instead of sprintf() to avoid buffer overflow.

Found with the SVACE static analysis tool
---
 tools/l2test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com June 28, 2024, 2:41 p.m. UTC | #1
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=866579

---Test result---

Test Summary:
CheckPatch                    PASS      0.43 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      24.84 seconds
BluezMake                     PASS      1701.86 seconds
MakeCheck                     PASS      12.81 seconds
MakeDistcheck                 PASS      178.71 seconds
CheckValgrind                 PASS      253.05 seconds
CheckSmatch                   PASS      354.23 seconds
bluezmakeextell               PASS      120.52 seconds
IncrementalBuild              PASS      1433.99 seconds
ScanBuild                     PASS      1002.24 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org June 28, 2024, 3:10 p.m. UTC | #2
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:01:41 +0300 you wrote:
> Use snprintf() instead of sprintf() to avoid buffer overflow.
> 
> Found with the SVACE static analysis tool
> ---
>  tools/l2test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v1] l2test: replace sprintf() with snprintf() in recv_mode()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0bd3d1505e3a

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/l2test.c b/tools/l2test.c
index 7b6c36e16..4c2296899 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -913,7 +913,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);
 				}