summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-06-22 11:09:04 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-06-22 11:09:04 -0700
commit33c96ca658fd7a0d358dd714decf465ff17ee043 (patch)
tree180667474dce9bf610e1b659235062e31d11fd6e /client
parente4fd2dc5aa959ba430ee0038e4d135e1a7530ad4 (diff)
downloadbluez-33c96ca658fd7a0d358dd714decf465ff17ee043.tar.gz
client/player: Fixes errors found by scan-build
This fixes the following errors: client/player.c:1406:44: warning: Dereference of null pointer [core.NullDereference] reply = endpoint_select_config_reply(msg, p->data.iov_base, ^~~~~~~~~~~~~~~~ client/player.c:1866:2: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage] iov_append(&cfg->caps, data, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'client')
-rw-r--r--client/player.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/player.c b/client/player.c
index 2ba05c43c..3e9a457ec 100644
--- a/client/player.c
+++ b/client/player.c
@@ -1403,6 +1403,12 @@ static DBusMessage *endpoint_select_configuration(DBusConnection *conn,
if (!p)
NULL;
+ if (p->data.iov_base) {
+ reply = g_dbus_create_error(msg, "org.bluez.Error.Rejected",
+ NULL);
+ return reply;
+ }
+
reply = endpoint_select_config_reply(msg, p->data.iov_base,
p->data.iov_len);
if (!reply)
@@ -1859,7 +1865,7 @@ static void endpoint_config(const char *input, void *user_data)
{
struct endpoint_config *cfg = user_data;
uint8_t *data;
- size_t len;
+ size_t len = 0;
data = str2bytearray((char *) input, &len);