From: Luiz Augusto von Dentz Date: Wed, 22 Jun 2022 18:09:04 +0000 (-0700) Subject: client/player: Fixes errors found by scan-build X-Git-Tag: accepted/tizen/unified/20230608.164325~180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1019084fc36163f9fa86bea5a1d91ab4d4506902;p=platform%2Fupstream%2Fbluez.git 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); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Manika Shrivastava Signed-off-by: Ayush Garg --- diff --git a/client/player.c b/client/player.c index 6948685..52a6177 100644 --- a/client/player.c +++ b/client/player.c @@ -1402,6 +1402,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) @@ -1858,7 +1864,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);