[IOT-2282] Do not update ACL in SVR DB when receive NULL aces from cloud
authorAndrii Shtompel <a.shtompel@samsung.com>
Sun, 21 May 2017 09:52:05 +0000 (12:52 +0300)
committerDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Sun, 21 May 2017 11:29:20 +0000 (11:29 +0000)
Change-Id: I0aea3490cd9f41c6a192c2ed87d8f49c80f6ac3c
Signed-off-by: Andrii Shtompel <a.shtompel@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20193
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Oleksii Beketov <ol.beketov@samsung.com>
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
resource/csdk/security/provisioning/src/cloud/aclid.c

index 03881488a750214fd8402fd2d3e8b8216c2a2d69..37f29bd5def6e84224320ff85de27de960d5d6a5 100644 (file)
@@ -194,6 +194,13 @@ static OCStackResult handleAclGetInfoResponse(void *ctx, void **data, OCClientRe
 
     OIC_LOG_ACL(INFO, acl);
 
+    if (NULL == acl->aces)
+    {
+        OIC_LOG(WARNING, TAG, "NULL aces received. Database update is not required");
+        OIC_LOG(WARNING, TAG, "Assume that it is correct behavior");
+        goto exit;
+    }
+
     result = InstallACL(acl);
     if (result != OC_STACK_OK)
     {