diff mbox series

[BlueZ,v1] shared/vcp: add NULL checks to foreach_vocs_service()

Message ID 20240702084907.26066-1-r.smirnov@omp.ru (mailing list archive)
State Accepted
Commit 176cf2e12a289f9f94666e188c79fa6cc1ff249b
Headers show
Series [BlueZ,v1] shared/vcp: add NULL checks to foreach_vocs_service() | 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 July 2, 2024, 8:49 a.m. UTC
Make foreach_vocs_service() safe for passing NULL pointers.

Found with the SVACE static analysis tool.
---
 src/shared/vcp.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

bluez.test.bot@gmail.com July 2, 2024, 10:43 a.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=867449

---Test result---

Test Summary:
CheckPatch                    PASS      0.39 seconds
GitLint                       PASS      0.27 seconds
BuildEll                      PASS      24.70 seconds
BluezMake                     PASS      1736.53 seconds
MakeCheck                     PASS      13.63 seconds
MakeDistcheck                 PASS      179.86 seconds
CheckValgrind                 PASS      254.62 seconds
CheckSmatch                   PASS      361.60 seconds
bluezmakeextell               PASS      120.88 seconds
IncrementalBuild              PASS      1490.20 seconds
ScanBuild                     PASS      1041.47 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org July 3, 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 Tue, 2 Jul 2024 11:49:07 +0300 you wrote:
> Make foreach_vocs_service() safe for passing NULL pointers.
> 
> Found with the SVACE static analysis tool.
> ---
>  src/shared/vcp.c | 3 +++
>  1 file changed, 3 insertions(+)

Here is the summary with links:
  - [BlueZ,v1] shared/vcp: add NULL checks to foreach_vocs_service()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=176cf2e12a28

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/shared/vcp.c b/src/shared/vcp.c
index b7e17e448..06264a241 100644
--- a/src/shared/vcp.c
+++ b/src/shared/vcp.c
@@ -2701,6 +2701,9 @@  static void foreach_vocs_service(struct gatt_db_attribute *attr,
 	struct bt_vcp *vcp = user_data;
 	struct bt_vocs *vocs = vcp_get_vocs(vcp);
 
+	if (!vocs || !attr)
+		return;
+
 	vocs->service = attr;
 
 	gatt_db_service_set_claimed(attr, true);