From 2d07cf4c8706be857c7ffeeb72d1d18346eb072d Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Mon, 3 Nov 2014 16:42:20 -0800 Subject: [PATCH] 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 --- csdk/occoap/src/occoaphelper.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.7.4