Fix issue related SVACE in oickeepalive 11/7611/2
authorJaehong Jo <jaehong.jo@samsung.com>
Thu, 31 Mar 2016 07:16:52 +0000 (16:16 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Tue, 5 Apr 2016 13:27:49 +0000 (13:27 +0000)
Change-Id: I4c788411bcd8eb4251d292e0bf56ab470dfcafc1
Signed-off-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/7481
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
(cherry picked from commit ede0115adf224edcca0d80c6f7f87140c0de8451)
Reviewed-on: https://gerrit.iotivity.org/gerrit/7611
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/stack/src/oickeepalive.c

index 14b8f0b..8063f2b 100644 (file)
@@ -386,7 +386,7 @@ OCStackResult HandleKeepAlivePUTRequest(const CAEndpoint_t* endPoint,
                    requestInfo->info.payload, requestInfo->info.payloadSize);
     OCRepPayload *repPayload = (OCRepPayload *)ocPayload;
 
-    uint32_t interval = 0;
+    int64_t interval = 0;
     OCRepPayloadGetPropInt(repPayload, INTERVAL, &interval);
     entry->interval = interval;
     OIC_LOG_V(DEBUG, TAG, "Received interval is [%d]", entry->interval);
@@ -446,9 +446,11 @@ OCStackResult HandleKeepAliveResponse(const CAEndpoint_t *endPoint,
             return SendPingMessage(entry);
         }
     }
-
-    // Set sentPingMsg values with false.
-    entry->sentPingMsg = false;
+    else
+    {
+        // Set sentPingMsg values with false.
+        entry->sentPingMsg = false;
+    }
 
     OIC_LOG(DEBUG, TAG, "HandleKeepAliveResponse OUT");
     return OC_STACK_OK;