Fix defects detected by static code analyzer
authorParkhi <h_w.park@samsung.com>
Fri, 17 Mar 2017 08:20:07 +0000 (17:20 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 20 Mar 2017 02:07:42 +0000 (02:07 +0000)
Change-Id: I63dbeed58bae6c943ce8374685bcdaea867ec57e
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17975
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp
service/easy-setup/sampleapp/mediator/linux/richsdk_sample/mediator.cpp
service/easy-setup/sampleapp/mediator/linux/richsdk_sample/submediator.cpp

index 42fa6fc..b553e93 100755 (executable)
@@ -220,7 +220,7 @@ namespace OIC
 
             bool ret = false;
             std::string subOwnerID;
-            char uuidString[UUID_STRING_SIZE];
+            char uuidString[UUID_STRING_SIZE] = {};
 
             OicSecSubOwner_t* subOwnerList = foundDevice->getDevPtr()->doxm->subOwners;
 
index 55513a8..19a8ad0 100755 (executable)
@@ -404,7 +404,7 @@ void discoveryEnrolleeResource()
 
         std::unique_lock<std::mutex> lck(g_discoverymtx);
         g_cond.wait_for(lck, std::chrono::seconds(5));
-       }
+    }
     catch (OCException &e)
     {
         std::cout << "Exception in discoveryEnrolleeResource: "<<e.what();
index 6bd699a..e08ef1a 100755 (executable)
@@ -401,11 +401,11 @@ void discoveryEnrolleeResource()
 
         std::unique_lock<std::mutex> lck(g_discoverymtx);
         g_cond.wait_for(lck, std::chrono::seconds(5));
-       }
-       catch (OCException& e)
-       {
-               std::cout << "Exception in discoveryEnrolleeResource: "<<e.what();
-       }
+    }
+    catch (OCException& e)
+    {
+        std::cout << "Exception in discoveryEnrolleeResource: "<<e.what();
+    }
 }
 
 void DisplayMenu()