RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
- if (IC_EQUAL != strncmp(IC_COAP_PREFIX, host_address, strlen(IC_COAP_PREFIX)))
+ if (host_address
+ && IC_EQUAL != strncmp(IC_COAP_PREFIX, host_address, strlen(IC_COAP_PREFIX)))
coap_str = IC_COAPS;
if (NULL == host_address) {
RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
- if (IC_EQUAL != strncmp(IC_COAP_PREFIX, host_address, strlen(IC_COAP_PREFIX)))
+ if (host_address
+ && IC_EQUAL != strncmp(IC_COAP_PREFIX, host_address, strlen(IC_COAP_PREFIX)))
coap_str = IC_COAP;
if (NULL == host_address)
RETV_IF(NULL == cb, IOTCON_ERROR_INVALID_PARAMETER);
- if (IC_EQUAL != strncmp(IC_COAP_PREFIX, host_address, strlen(IC_COAP_PREFIX)))
+ if (host_address
+ && IC_EQUAL != strncmp(IC_COAP_PREFIX, host_address, strlen(IC_COAP_PREFIX)))
coap_str = IC_COAP;
if (NULL == host_address)