From fa573fb95cc3e69b51c0b78957d1a37fe7b102f0 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Tue, 18 Nov 2014 14:06:12 -0800 Subject: [PATCH] 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 --- resource/csdk/occoap/src/occoaphelper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.7.4