Add to Null checking log in IsSameEowner
authorjs126.lee <js126.lee@samsung.com>
Tue, 29 Nov 2016 07:42:50 +0000 (16:42 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Tue, 29 Nov 2016 09:15:57 +0000 (09:15 +0000)
When building with MULTIPLE_OWNER=1, ace is updated as appending alwadys,
because the return value is false in IsSameEowner in case both ewoner1 and
ewoner 2 are NULL.

Change-Id: I0068db4196fb467e4c95d29ae808848d95776bbe
Signed-off-by: js126.lee <js126.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/14891
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-by: Jongmin Choi <jminl.choi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/aclresource.c

index e41cfa0..94118bc 100644 (file)
@@ -1705,13 +1705,18 @@ static bool IsSameValidities(OicSecValidity_t* validities1, OicSecValidity_t* va
 #ifdef _ENABLE_MULTIPLE_OWNER_
 static bool IsSameEowner(OicUuid_t* eowner1, OicUuid_t* eowner2)
 {
-    if(NULL != eowner1 && NULL != eowner2)
+    if (NULL != eowner1 && NULL != eowner2)
     {
         if (memcmp(eowner1->id, eowner2->id, sizeof(eowner1->id)) == 0)
         {
             return true;
         }
     }
+    else if (NULL == eowner1 && NULL == eowner2)
+    {
+        OIC_LOG(DEBUG, TAG, "Both eowner1 and eowner2 are NULL");
+        return true;
+    }
 
     return false;
 }