[IOT-1272] added null checker for address in setAutoConnectionDevice API
authorjihwan.seo <jihwan.seo@samsung.com>
Thu, 8 Sep 2016 08:33:48 +0000 (17:33 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Fri, 9 Sep 2016 07:20:49 +0000 (07:20 +0000)
Change-Id: Ib89a3856d3089d68e58e6d72112f76c59322f055
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11563
Reviewed-by: Suchita Sultana <suchita.rs@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
android/android_api/base/jni/JniCaInterface.c

index f5d25ff..06ff75b 100644 (file)
@@ -255,6 +255,11 @@ Java_org_iotivity_ca_CaInterface_caManagerSetAutoConnectionDeviceInfo(JNIEnv *en
                                                                       jstring jaddress)
 {
     LOGI("CaManager_setAutoConnectionDeviceInfo");
+    if (!jaddress)
+    {
+        LOGE("jaddress is null");
+        return;
+    }
 
     const char* address = (*env)->GetStringUTFChars(env, jaddress, NULL);
     if (!address)
@@ -274,6 +279,11 @@ Java_org_iotivity_ca_CaInterface_caManagerUnsetAutoConnectionDeviceInfo(JNIEnv *
                                                                         jstring jaddress)
 {
     LOGI("CaManager_unsetAutoConnectionDeviceInfo");
+    if (!jaddress)
+    {
+        LOGE("jaddress is null");
+        return;
+    }
 
     const char* address = (*env)->GetStringUTFChars(env, jaddress, NULL);
     if (!address)