Fix for Sonarqube Bugs 88/235988/1
authorsamanway <samanway@linux-samanway.sa.corp.samsungelectronics.net>
Fri, 17 Apr 2020 04:52:50 +0000 (10:22 +0530)
committerSudipto <sudipto.bal@samsung.com>
Thu, 11 Jun 2020 18:15:56 +0000 (23:45 +0530)
- Redundant condition checking reported in caleclient.c, corrected
- Added NULL check in NSProviderTopic.c

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/683
(cherry-picked from 904203befcb4bfd93a2f91f5b97c792715196992)

Change-Id: Id8c7d6e4b91693d4ef07c10e0628ef1546870cf6
Signed-off-by: samanway-dey <samanway.dey@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c
service/notification/src/provider/NSProviderTopic.c

index 856c42e..b57dc0a 100755 (executable)
@@ -910,7 +910,7 @@ CAResult_t CALEClientIsThereScannedDevices(JNIEnv *env, const char* address)
                 if (0 < scannedDeviceLen)
                 {
                     if (!address  // multicast
-                        || (address && CALEClientIsDeviceInScanDeviceList(env, address))) // unicast
+                        || CALEClientIsDeviceInScanDeviceList(env, address)) // unicast
                     {
                       devicesDiscovered = true;
                       break;
index 9b3da30..fae5673 100644 (file)
@@ -500,7 +500,7 @@ void * NSTopicSchedule(void * ptr)
                     }
                     else
                     {
-                        if (NSProviderStorageRead(registeredTopicList, subData->topicName))
+                        if (subData && NSProviderStorageRead(registeredTopicList, subData->topicName))
                         {
                             newObj->data = topicSyncResult->topicData;
                             newObj->next = NULL;