From: Erich Keane Date: Tue, 4 Nov 2014 00:42:20 +0000 (-0800) Subject: Fix crash issue after observation X-Git-Tag: 1.2.0+RC1~2133^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d07cf4c8706be857c7ffeeb72d1d18346eb072d;p=platform%2Fupstream%2Fiotivity.git Fix crash issue after observation I discovered a crash in simpleserver C++ that when being debugged, it would crash on the observation AFTER the client had cancelled. The cause was that the NumberRecvHeaderOptions sent was an invalid character rather than 0! This fix repairs the issue by ensuring that the values are initialized correctly. Change-Id: I35a0a0aa45d356208f1cd563f3558997665881db Signed-off-by: Erich Keane --- diff --git a/csdk/occoap/src/occoaphelper.c b/csdk/occoap/src/occoaphelper.c index 829e807..351281e 100644 --- a/csdk/occoap/src/occoaphelper.c +++ b/csdk/occoap/src/occoaphelper.c @@ -396,6 +396,9 @@ OCStackResult FormOCEntityHandlerRequest(OCEntityHandlerRequest * entityHandlerR entityHandlerRequestLoc->obsInfo = NULL; entityHandlerRequestLoc->newResourceUri = newResUriBuf; + + entityHandlerRequestLoc->numRcvdVendorSpecificHeaderOptions = 0; + entityHandlerRequestLoc->numSendVendorSpecificHeaderOptions = 0; return OC_STACK_OK; }