[IOT-2331] segmentation fault in aclresource.c 69/20169/3
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Sat, 20 May 2017 10:34:48 +0000 (13:34 +0300)
committerDmitriy Zhuravlev <d.zhuravlev@samsung.com>
Sun, 21 May 2017 10:31:14 +0000 (10:31 +0000)
Linux enrollee sample crashes - segmentation fault in aclresource.c

Change-Id: Id6d50d29184e239ac7cc3371918bed8980c35204
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20169
Reviewed-by: Andrii Shtompel <a.shtompel@samsung.com>
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
resource/csdk/security/src/aclresource.c

index 5c2b637..84de7f2 100644 (file)
@@ -2299,7 +2299,8 @@ static bool IsSameResources(OicSecRsrc_t* resources1, OicSecRsrc_t* resources2)
             rsrc2 = NULL;
             LL_FOREACH(resources2, rsrc2)
             {
-                if(rsrc1 && rsrc2)
+                if (rsrc1 && rsrc2 &&
+                    rsrc1->href && rsrc2->href)
                 {
                     if(strcmp(rsrc1->href, rsrc2->href) == 0 &&
                         IsSameStringArray(rsrc1->interfaces, rsrc1->interfaceLen,