X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Fcommon%2Fsrc%2Fcaremotehandler.c;h=61a250993d42a3577bc0366848fc9b9f3b0506f8;hb=390866079e285d2c74918432c0d597d5da52f8a0;hp=a39b7d48cecc5652f1795012a22447a840a10d34;hpb=17c68b2fd1e74586f85e552eeab4e32dc121f8a0;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/common/src/caremotehandler.c b/resource/csdk/connectivity/common/src/caremotehandler.c index a39b7d4..61a2509 100644 --- a/resource/csdk/connectivity/common/src/caremotehandler.c +++ b/resource/csdk/connectivity/common/src/caremotehandler.c @@ -55,6 +55,20 @@ CARequestInfo_t *CACloneRequestInfo(const CARequestInfo_t *rep) return NULL; } + // check the method type of request info. + // Keep this check in sync with CAMethod_t + switch (rep->method) + { + case CA_GET: + case CA_POST: + case CA_PUT: + case CA_DELETE: + break; + default: + OIC_LOG_V(ERROR, TAG, "Method %u is invalid", rep->method); + return NULL; + } + // allocate the request info structure. CARequestInfo_t *clone = (CARequestInfo_t *) OICMalloc(sizeof(CARequestInfo_t)); if (!clone) @@ -267,6 +281,8 @@ CAResult_t CACloneInfo(const CAInfo_t *info, CAInfo_t *clone) clone->numOptions = info->numOptions; } + memcpy(&(clone->identity), &(info->identity), sizeof(info->identity)); + if ((info->payload) && (0 < info->payloadSize)) { // allocate payload field