From: Omkar Hegde Date: Mon, 6 Oct 2014 16:40:00 +0000 (-0700) Subject: 1. Added a check in ocstack.c for the Maximum JSON payload that can be sent. X-Git-Tag: 0.9.0-CA-RC1~125 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1915ffd349387be3f2ce447ed21afbc0b90679f4;p=contrib%2Fiotivity.git 1. Added a check in ocstack.c for the Maximum JSON payload that can be sent. 2. Added specific error message to result. Changes in if() as suggested. 4. Replaced tab with spaces and moved the check before any processing begins. Change-Id: Id06ce2f7deaf643acd4f3cf4fcdd9ce30e2eddbc --- diff --git a/csdk/stack/src/ocstack.c b/csdk/stack/src/ocstack.c index ebaae39..4138c58 100644 --- a/csdk/stack/src/ocstack.c +++ b/csdk/stack/src/ocstack.c @@ -415,6 +415,12 @@ OCStackResult OCDoResource(OCDoHandle *handle, OCMethod method, const char *requ goto exit; } + if((request) && (strlen(request) > MAX_REQUEST_LENGTH)) + { + result = OC_STACK_INVALID_PARAM; + goto exit; + } + requestUri = (unsigned char *) OCMalloc(uriLen + 1); if(requestUri) {