From cb699f9e7b6fede0c32c254aa5572e349854ea30 Mon Sep 17 00:00:00 2001 From: KIM JungYong Date: Tue, 4 Oct 2016 14:06:36 +0900 Subject: [PATCH] Fix bug for multiple extras of message. When the receive multiple extras in the message from notification provider, consuemr service misparse as parsing just one extras for incorrect operation of pointers. In this patch, incorrect operation of pointers is fixed. Change-Id: Ifacaf247ca836d81031ffe93b0b72d2b46db65f3 Signed-off-by: KIM JungYong Reviewed-on: https://gerrit.iotivity.org/gerrit/12745 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/notification/src/consumer/NSConsumerCommunication.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/service/notification/src/consumer/NSConsumerCommunication.c b/service/notification/src/consumer/NSConsumerCommunication.c index 0554a01..c9a85f2 100644 --- a/service/notification/src/consumer/NSConsumerCommunication.c +++ b/service/notification/src/consumer/NSConsumerCommunication.c @@ -350,18 +350,22 @@ OCRepPayload * NSGetExtraInfo(OCRepPayload * payload) if (isFirstExtra) { headValue = curValue; + extraInfo->values = headValue; isFirstExtra = false; } - curValue = curValue->next; + else + { + headValue->next = curValue; + headValue = curValue; + } curValue = NULL; } value = value->next; } OCRepPayloadDestroy(origin); - extraInfo->values = headValue; - if (extraInfo->values) + if (!isFirstExtra && extraInfo->values) { return extraInfo; } -- 2.7.4