From: Erich Keane Date: Tue, 18 Nov 2014 22:06:12 +0000 (-0800) Subject: Fixed: bug where Header Option count would be zero X-Git-Tag: 1.2.0+RC1~2092^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa573fb95cc3e69b51c0b78957d1a37fe7b102f0;p=platform%2Fupstream%2Fiotivity.git Fixed: bug where Header Option count would be zero 01.org IOT-76 Header options had a defect introduced attempting to fix the 'zero' header option count value. In the previous defect, the stack would have an uninitialized header options count when there were none. The previous fix has been removed and initialization has been done in the correct place. Change-Id: I99e0539f86573cfa7392921e1fdfe25dd80b303a Signed-off-by: Erich Keane --- diff --git a/resource/csdk/occoap/src/occoaphelper.c b/resource/csdk/occoap/src/occoaphelper.c index 3d4e2bc..ceed9dd 100644 --- a/resource/csdk/occoap/src/occoaphelper.c +++ b/resource/csdk/occoap/src/occoaphelper.c @@ -300,8 +300,9 @@ OCStackResult ParseCoAPPdu(coap_pdu_t * pdu, unsigned char * uriBuf, OC_LOG_BUFFER(INFO, TAG, rcvVendorSpecificHeaderOptions[i].optionData, rcvVendorSpecificHeaderOptions[i].optionLength); i++; - *numRcvVendorSpecificHeaderOptions = i; } + + *numRcvVendorSpecificHeaderOptions = i; } // get the payload @@ -400,7 +401,6 @@ OCStackResult FormOCEntityHandlerRequest(OCEntityHandlerRequest * entityHandlerR entityHandlerRequestLoc->obsInfo = NULL; entityHandlerRequestLoc->newResourceUri = newResUriBuf; - entityHandlerRequestLoc->numRcvdVendorSpecificHeaderOptions = 0; entityHandlerRequestLoc->numSendVendorSpecificHeaderOptions = 0; return OC_STACK_OK; }