2024-04-23 07:45:00

by Sarveshwar Bajaj

[permalink] [raw]
Subject: [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs()

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(-)

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)
--
2.21.0.windows.1



2024-04-23 07:45:09

by Sarveshwar Bajaj

[permalink] [raw]
Subject: [PATCH BlueZ v1 0/1] Fix null pointer deference in bap_get_ascs()

Hi team,

This is the fix for preventing crash for null pointer dereference.

Ensure that bap and rdb pointers are valid before accessing or allocating
memory for ascs. Added null check to prevent potential crash


Sarveshwar Bajaj (1):
Fix null pointer deference in bap_get_ascs()

src/shared/bap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--
2.21.0.windows.1


2024-04-23 09:57:27

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,v1,1/1] Fix null pointer deference in bap_get_ascs()

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

2024-04-29 14:51:52

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH BlueZ v1 1/1] Fix null pointer deference in bap_get_ascs()

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html