[IOT-1048][Security][Dangling Pointer] Address of local variable goes out of function...
authorjs126.lee <js126.lee@samsung.com>
Thu, 31 Mar 2016 02:58:30 +0000 (11:58 +0900)
committerRandeep Singh <randeep.s@samsung.com>
Thu, 31 Mar 2016 08:12:28 +0000 (08:12 +0000)
Related JIRA ticket : https://jira.iotivity.org/browse/IOT-1048

Patch 1: Init
Patch 2: Apply Mr. Kang's comment

Change-Id: I6f6fb829df89517fc24bed77a9f2827af10ef1de
Signed-off-by: js126.lee <js126.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7471
Reviewed-by: Yonggoo Kang <ygace.kang@samsung.com>
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-by: Kyungsun Cho <goodsun.cho@samsung.com>
Reviewed-by: Dmitriy Zhuravlev <d.zhuravlev@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/ck_manager/sample/Door_sample.cpp [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 03567eb..316d0da
@@ -40,6 +40,7 @@
 #define DEFAULT_CONTEXT_VALUE 0x99
 #define STATE "state"
 #define OPEN_DURATION "openDuration"
+#define OPEN_DURATION_TIME "10min"
 #define OPEN_ALARM "openAlarm"
 
 static const char MULTICAST_DISCOVERY_QUERY[] = "/oic/res";
@@ -336,8 +337,7 @@ int  createDoorResource (const char *uri, DoorResource *doorResource)
     }
 
     doorResource->state = STATE_CLOSED; //1:closed , 0: open
-    char str[] = "10min";
-    doorResource->openDuration = str;
+    doorResource->openDuration = OPEN_DURATION_TIME;
     doorResource->openAlarm = false;
     OCStackResult res = OCCreateResource(&(doorResource->handle),
                                          "core.door",