From: HyunJun Kim Date: Thu, 2 Apr 2015 07:07:55 +0000 (+0900) Subject: Fix minor issue for Group Action of ThingsManager. X-Git-Tag: 1.2.0+RC1~1869 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6cf11104fffaed37656d1450d8dd7bc6cfdd04fe;p=platform%2Fupstream%2Fiotivity.git Fix minor issue for Group Action of ThingsManager. addActionSet and executeActionSet do not return error message when entered invalid parameters. In this case, we return 'OC_STACK_INVALID_PARAM'. getActionSetfromString didn't return when entered malformed string. It will be returned NULL in this case. Change-Id: Ifd28640d6aca6714646b33ea8fb69c55f8ca36f7 Signed-off-by: HyunJun Kim Reviewed-on: https://gerrit.iotivity.org/gerrit/631 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/things-manager/sdk/src/GroupManager.cpp b/service/things-manager/sdk/src/GroupManager.cpp index 40f7b45..e418b87 100755 --- a/service/things-manager/sdk/src/GroupManager.cpp +++ b/service/things-manager/sdk/src/GroupManager.cpp @@ -502,6 +502,13 @@ ActionSet* GroupManager::getActionSetfromString(std::string description) Capability *capa = NULL; ActionSet *actionset = new ActionSet(); + + + if( description.at(0) == '*') + { + goto exit; + } + plainText = new char[(description.length() + 1)]; strcpy(plainText, description.c_str()); @@ -629,6 +636,11 @@ OCStackResult GroupManager::addActionSet(std::shared_ptr< OCResource > resource, // BUILD message of ActionSet which it is included delimiter. if ((resource != NULL) && (newActionSet != NULL)) { + if(newActionSet->mDelay < 0) + { + return OC_STACK_INVALID_PARAM; + } + std::string message = getStringFromActionSet(newActionSet); OCRepresentation rep; @@ -662,7 +674,7 @@ OCStackResult GroupManager::executeActionSet(std::shared_ptr< OCResource > resou OCStackResult GroupManager::executeActionSet(std::shared_ptr< OCResource > resource, std::string actionsetName, long int delay, PostCallback cb) { - if(delay == 0 ) + if(delay <= 0 ) { return OC_STACK_INVALID_PARAM; }