diff mbox series

[BlueZ,v1,1/1] Fix null pointer deference in bap_get_ascs()

Message ID 20240423074426.62480-1-sarveshwar.bajaj@nxp.com
State New
Headers show
Series [BlueZ,v1,1/1] Fix null pointer deference in bap_get_ascs() | expand

Commit Message

Sarveshwar Bajaj April 23, 2024, 7:44 a.m. UTC
Ensure that bap and rdb pointers are valid before accessing or
allocating memory for ascs. Added  null check to prevent potential
crash
---
 src/shared/bap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com April 23, 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=846898

---Test result---

Test Summary:
CheckPatch                    PASS      0.29 seconds
GitLint                       PASS      0.21 seconds
BuildEll                      PASS      24.58 seconds
BluezMake                     PASS      1601.80 seconds
MakeCheck                     PASS      13.30 seconds
MakeDistcheck                 PASS      165.87 seconds
CheckValgrind                 PASS      232.35 seconds
CheckSmatch                   WARNING   333.77 seconds
bluezmakeextell               PASS      118.82 seconds
IncrementalBuild              PASS      1420.00 seconds
ScanBuild                     PASS      1028.67 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/bap.c:282:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:282:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structuressrc/shared/bap.c:282:25: warning: array of flexible structuressrc/shared/bap.c: note: in included file:./src/shared/ascs.h:88:25: warning: array of flexible structures


---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org April 29, 2024, 2:50 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, 23 Apr 2024 13:14:25 +0530 you wrote:
> Ensure that bap and rdb pointers are valid before accessing or
> allocating memory for ascs. Added  null check to prevent potential
> crash
> ---
>  src/shared/bap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v1,1/1] Fix null pointer deference in bap_get_ascs()
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d2a2aabee646

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 71eadbdb6..0db9ba285 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -1405,7 +1405,7 @@  static bool match_req(const void *data, const void *match_data)
 
 static struct bt_ascs *bap_get_ascs(struct bt_bap *bap)
 {
-	if (!bap)
+	if (!bap || !bap->rdb)
 		return NULL;
 
 	if (bap->rdb->ascs)