This patch fixes the the below issue reported by
cppcheck tool in stack dir:
"(error) Possible null pointer dereference:
ehResponse - otherwise it is redundant to check if
ehResponse is null at line 445
"
Dereferencing of ehResponse is done after NULL check.
Change-Id: I9cc20ce2386b5bdb08c4d9f9dbd2d143040f9a0f
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1509
Reviewed-by: Erich Keane <erich.keane@intel.com>
Tested-by: Erich Keane <erich.keane@intel.com>
CAResponseInfo_t responseInfo = {};
CAHeaderOption_t* optionsPointer = NULL;
- OC_LOG_V(INFO, TAG, "Inside HandleSingleResponse: %s", ehResponse->payload);
-
if(!ehResponse || !ehResponse->requestHandle)
{
return OC_STACK_ERROR;
}
+ OC_LOG_V(INFO, TAG, "Inside HandleSingleResponse: %s", ehResponse->payload);
+
if(ehResponse->payloadSize >= (MAX_RESPONSE_LENGTH))// - OC_JSON_PREFIX_LEN - OC_JSON_SUFFIX_LEN))
{
OC_LOG_V(ERROR, TAG, "Response payload size was too large. Max is %hu, payload size was %hu",