diff mbox series

[BlueZ,v1] shared/csip: add NULL check to foreach_csis_service()

Message ID 20240702080132.16169-1-r.smirnov@omp.ru (mailing list archive)
State Accepted
Commit 5f0002cc90997d14083e54a91c1f45134b7905a0
Headers show
Series [BlueZ,v1] shared/csip: add NULL check to foreach_csis_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:01 a.m. UTC
It is necessary to prevent dereferencing of a NULL pointer.

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

Comments

bluez.test.bot@gmail.com July 2, 2024, 9:40 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=867433

---Test result---

Test Summary:
CheckPatch                    PASS      0.84 seconds
GitLint                       PASS      0.32 seconds
BuildEll                      PASS      24.46 seconds
BluezMake                     PASS      1564.46 seconds
MakeCheck                     PASS      16.61 seconds
MakeDistcheck                 PASS      176.76 seconds
CheckValgrind                 PASS      252.55 seconds
CheckSmatch                   PASS      352.90 seconds
bluezmakeextell               PASS      120.30 seconds
IncrementalBuild              PASS      1377.09 seconds
ScanBuild                     PASS      998.68 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:01:32 +0300 you wrote:
> It is necessary to prevent dereferencing of a NULL pointer.
> 
> Found with the SVACE static analysis tool.
> ---
>  src/shared/csip.c | 3 +++
>  1 file changed, 3 insertions(+)

Here is the summary with links:
  - [BlueZ,v1] shared/csip: add NULL check to foreach_csis_service()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5f0002cc9099

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/shared/csip.c b/src/shared/csip.c
index 87b4590d9..a9c57c9bd 100644
--- a/src/shared/csip.c
+++ b/src/shared/csip.c
@@ -611,6 +611,9 @@  static void foreach_csis_service(struct gatt_db_attribute *attr,
 	struct bt_csip *csip = user_data;
 	struct bt_csis *csis = csip_get_csis(csip);
 
+	if (!csis)
+		return;
+
 	csis->service = attr;
 
 	gatt_db_service_set_claimed(attr, true);