Skip to content

Commit

Permalink
client/player: Fixes errors found by scan-build
Browse files Browse the repository at this point in the history
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);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
Vudentz committed Jun 22, 2022
1 parent e4fd2dc commit 33c96ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/player.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 33c96ca

Please sign in to comment.