diff mbox series

[BlueZ,1/2] client/player: Fix crashes accessing metadata

Message ID 20230511000155.3721222-1-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 67fd8479f11c12e396494fe80cd1965ee7ff4500
Headers show
Series [BlueZ,1/2] client/player: Fix crashes accessing metadata | 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

Luiz Augusto von Dentz May 11, 2023, 12:01 a.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If metadata is not set the respective iovec is left NULL so it needs to
be checked before accessing its fields.
---
 client/player.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

bluez.test.bot@gmail.com May 11, 2023, 2:21 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=746595

---Test result---

Test Summary:
CheckPatch                    PASS      1.05 seconds
GitLint                       PASS      0.71 seconds
BuildEll                      PASS      26.91 seconds
BluezMake                     PASS      1003.92 seconds
MakeCheck                     PASS      12.50 seconds
MakeDistcheck                 PASS      155.98 seconds
CheckValgrind                 PASS      252.51 seconds
CheckSmatch                   PASS      338.80 seconds
bluezmakeextell               PASS      102.02 seconds
IncrementalBuild              PASS      1716.07 seconds
ScanBuild                     PASS      1049.43 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org May 12, 2023, 8:40 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 10 May 2023 17:01:54 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> If metadata is not set the respective iovec is left NULL so it needs to
> be checked before accessing its fields.
> ---
>  client/player.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Here is the summary with links:
  - [BlueZ,1/2] client/player: Fix crashes accessing metadata
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=67fd8479f11c
  - [BlueZ,2/2] shared/bap: Fix not sending ASE Receiver Stop Ready
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=24b4ba1a3936

You are awesome, thank you!
diff mbox series

Patch

diff --git a/client/player.c b/client/player.c
index f055ff941569..091d7005f42a 100644
--- a/client/player.c
+++ b/client/player.c
@@ -1743,7 +1743,7 @@  static void append_properties(DBusMessageIter *iter,
 					DBUS_TYPE_BYTE, &cfg->caps->iov_base,
 					cfg->caps->iov_len);
 
-	if (cfg->meta->iov_len) {
+	if (cfg->meta && cfg->meta->iov_len) {
 		g_dbus_dict_append_basic_array(&dict, DBUS_TYPE_STRING, &meta,
 				DBUS_TYPE_BYTE, &cfg->meta->iov_base,
 				cfg->meta->iov_len);
@@ -1850,7 +1850,8 @@  static DBusMessage *endpoint_select_properties_reply(struct endpoint *ep,
 	cfg->target_latency = preset->target_latency;
 
 	/* Copy metadata */
-	iov_append(&cfg->meta, cfg->ep->meta->iov_base, cfg->ep->meta->iov_len);
+	if (ep->meta)
+		iov_append(&cfg->meta, ep->meta->iov_base, ep->meta->iov_len);
 
 	if (preset->qos.phy)
 		/* Set QoS parameters */