Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions src/bt-ifce/btrCore_dbus_bluez5.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:

Check failure on line 3 in src/bt-ifce/btrCore_dbus_bluez5.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/bt-ifce/btrCore_dbus_bluez5.c' (Match: rdk/components/generic/bluetooth/rdk/components/generic/bluetooth/2006, 9889 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/bluetooth/+archive/rdk-dev-2006.tar.gz, file: src/bt-ifce/btrCore_dbus_bluez5.c)

Check failure on line 3 in src/bt-ifce/btrCore_dbus_bluez5.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/bt-ifce/btrCore_dbus_bluez5.c' (Match: rdk/components/generic/bluetooth/rdk/components/generic/bluetooth/2007, 9889 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/bluetooth/+archive/rdk-dev-2007.tar.gz, file: src/bt-ifce/btrCore_dbus_bluez5.c)

Check failure on line 3 in src/bt-ifce/btrCore_dbus_bluez5.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/bt-ifce/btrCore_dbus_bluez5.c' (Match: rdk/components/generic/bluetooth/rdk/components/generic/bluetooth/2011, 9889 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/bluetooth/+archive/RDK-DEV-2011.tar.gz, file: src/bt-ifce/btrCore_dbus_bluez5.c)

Check failure on line 3 in src/bt-ifce/btrCore_dbus_bluez5.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'src/bt-ifce/btrCore_dbus_bluez5.c' (Match: rdk/components/generic/bluetooth/rdk/components/generic/bluetooth/2010, 9889 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/bluetooth/+archive/rdk-dev-2010.tar.gz, file: src/bt-ifce/btrCore_dbus_bluez5.c)
*
* Copyright 2016 RDK Management
*
Expand Down Expand Up @@ -215,14 +215,24 @@
static int btrCore_BTRegisterLeAdvGetProp (DBusConnection* apDBusConn, DBusMessage* apDBusMsg, stBtIfceHdl* apstlhBtIfce);
static DBusMessage* btrCore_BTLEGattOps (DBusMessage* apDBusMsg, stBtIfceHdl* apstlhBtIfce, enBTOpIfceType aenIfceType, enBTLeGattOp aenGattOp);
static int btrCore_BTReleaseLEGattObjPath(char* apstObjPath, void* apvUserData);
static bool btrCore_IsPathValid (char *path);
static bool btrCore_IsPathValid (const char * path);
/* Incoming Callbacks Prototypes */
static DBusHandlerResult btrCore_BTDBusConnectionFilterCb (DBusConnection* apDBusConn, DBusMessage* apDBusMsg, void* apvUserData);
static DBusHandlerResult btrCore_BTMediaEndpointHandlerCb (DBusConnection* apDBusConn, DBusMessage* apDBusMsg, void* apvUserData);
static DBusHandlerResult btrCore_BTAgentMessageHandlerCb (DBusConnection* apDBusConn, DBusMessage* apDBusMsg, void* apvUserData);
static DBusHandlerResult btrCore_BTLeGattEndpointHandlerCb(DBusConnection* apDBusConn, DBusMessage* apDBusMsg, void* apvUserData);
static DBusHandlerResult btrCore_BTLeGattMessageHandlerCb (DBusConnection* apDBusConn, DBusMessage* apDBusMsg, void* apvUserData);

static bool btrCore_IsPathValid(const char * path) {
if(!path) {
BTRCORELOG_ERROR ("path is NULL\n");
return false;
}

BTRCORELOG_INFO ("path value is: %s\n", path);

return strncmp(path, "/", strlen("/")) == 0;
}

static const DBusObjectPathVTable gDBusMediaEndpointVTable = {
.message_function = btrCore_BTMediaEndpointHandlerCb,
Expand Down Expand Up @@ -3894,7 +3904,11 @@
BTRCORELOG_ERROR ("Invalid Interface Property\n");
return -1;
}


if (!btrCore_IsPathValid(apcBtOpIfcePath)) {
BTRCORELOG_ERROR("Invalid apcBtOpIfcePath\n");
return -1;
}

lpDBusMsg = dbus_message_new_method_call(BT_DBUS_BLUEZ_PATH,
apcBtOpIfcePath,
Expand Down Expand Up @@ -5072,17 +5086,6 @@
return match;
}

static bool btrCore_IsPathValid(char *path) {
if(!path) {
BTRCORELOG_ERROR ("path is NULL\n");
return false;
}

BTRCORELOG_INFO ("path value is: %s\n", path);

return strncmp(path, "/", strlen("/")) == 0;
}

int
BtrCore_BTPerformAdapterOp (
void* apstBtIfceHdl,
Expand Down
Loading