From ca00c37c2f8583fb754d03ca37c716d7c1cd1401 Mon Sep 17 00:00:00 2001 From: Joonghwan Lee Date: Thu, 31 Mar 2016 11:57:40 +0900 Subject: [PATCH] Add empty string check of uuid Add empty string check code to prevent returning true when both uuid are empty string -Patch 1: Initial -Patch 2: Remove 'x' file permission Change-Id: Id9c50025593ad3bd14a74b874d442e8d3da441f7 Signed-off-by: Joonghwan Lee Reviewed-on: https://gerrit.iotivity.org/gerrit/7473 Tested-by: jenkins-iotivity Reviewed-by: Jongsung Lee Reviewed-by: Randeep Singh --- resource/csdk/security/src/policyengine.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resource/csdk/security/src/policyengine.c b/resource/csdk/security/src/policyengine.c index 8fc834c..04f0fc3 100644 --- a/resource/csdk/security/src/policyengine.c +++ b/resource/csdk/security/src/policyengine.c @@ -72,6 +72,11 @@ static bool UuidCmp(OicUuid_t *firstId, OicUuid_t *secondId) { return false; } + // Check empty uuid string + if('\0' == firstId->id[0] || '\0' == secondId->id[0]) + { + return false; + } for(int i = 0; i < UUID_LENGTH; i++) { if(firstId->id[i] != secondId->id[i]) -- 2.7.4