From f744bc43e56b717fafeee0a3215f17704e8ed33c Mon Sep 17 00:00:00 2001 From: samanway Date: Fri, 17 Apr 2020 10:22:50 +0530 Subject: [PATCH] Fix for Sonarqube Bugs - 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 Signed-off-by: Sudipto --- resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c | 2 +- service/notification/src/provider/NSProviderTopic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c b/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c index 856c42e..b57dc0a 100755 --- a/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c @@ -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; diff --git a/service/notification/src/provider/NSProviderTopic.c b/service/notification/src/provider/NSProviderTopic.c index 9b3da30..fae5673 100644 --- a/service/notification/src/provider/NSProviderTopic.c +++ b/service/notification/src/provider/NSProviderTopic.c @@ -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; -- 2.7.4