linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] client/assistant: Use strnlen() instead of strlen()
@ 2025-09-05 13:49 Roman Smirnov
  2025-09-05 15:15 ` [BlueZ] " bluez.test.bot
  2025-09-09 20:50 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2025-09-05 13:49 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Roman Smirnov

Using strlen() can lead to undefined behavior.
---
 client/assistant.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/assistant.c b/client/assistant.c
index 5850b5827..3551aaad8 100644
--- a/client/assistant.c
+++ b/client/assistant.c
@@ -261,7 +261,7 @@ static void assistant_set_bcode_cfg(const char *input, void *user_data)
 	if (!strcasecmp(input, "a") || !strcasecmp(input, "auto")) {
 		memset(cfg->qos.bcast.bcode, 0, BCODE_LEN);
 	} else {
-		if (strlen(input) > BCODE_LEN) {
+		if (strnlen(input, BCODE_LEN + 1) > BCODE_LEN) {
 			bt_shell_printf("Input string too long %s\n", input);
 			goto fail;
 		}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [BlueZ] client/assistant: Use strnlen() instead of strlen()
  2025-09-05 13:49 [PATCH BlueZ] client/assistant: Use strnlen() instead of strlen() Roman Smirnov
@ 2025-09-05 15:15 ` bluez.test.bot
  2025-09-09 20:50 ` [PATCH BlueZ] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-09-05 15:15 UTC (permalink / raw)
  To: linux-bluetooth, r.smirnov

[-- Attachment #1: Type: text/plain, Size: 1261 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=999352

---Test result---

Test Summary:
CheckPatch                    PENDING   0.28 seconds
GitLint                       PENDING   0.28 seconds
BuildEll                      PASS      20.90 seconds
BluezMake                     PASS      2708.44 seconds
MakeCheck                     PASS      20.14 seconds
MakeDistcheck                 PASS      193.26 seconds
CheckValgrind                 PASS      244.36 seconds
CheckSmatch                   PASS      314.61 seconds
bluezmakeextell               PASS      132.62 seconds
IncrementalBuild              PENDING   0.23 seconds
ScanBuild                     PASS      944.35 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ] client/assistant: Use strnlen() instead of strlen()
  2025-09-05 13:49 [PATCH BlueZ] client/assistant: Use strnlen() instead of strlen() Roman Smirnov
  2025-09-05 15:15 ` [BlueZ] " bluez.test.bot
@ 2025-09-09 20:50 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2025-09-09 20:50 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, 5 Sep 2025 16:49:39 +0300 you wrote:
> Using strlen() can lead to undefined behavior.
> ---
>  client/assistant.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ] client/assistant: Use strnlen() instead of strlen()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2efd925db0b5

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:[~2025-09-09 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 13:49 [PATCH BlueZ] client/assistant: Use strnlen() instead of strlen() Roman Smirnov
2025-09-05 15:15 ` [BlueZ] " bluez.test.bot
2025-09-09 20:50 ` [PATCH BlueZ] " 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;
as well as URLs for NNTP newsgroup(s).