From: youngman Date: Wed, 7 Sep 2016 05:13:12 +0000 (+0900) Subject: add null check when discovering X-Git-Tag: accepted/tizen/common/20160908.134429~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f044ddaea2300125c8552c5e413eea5b474f5af2;p=platform%2Fcore%2Fiot%2Fiotcon.git add null check when discovering Change-Id: I0055c5b61422d770261d8a46a3f34505d23921b0 Signed-off-by: youngman --- diff --git a/src/ic-ioty.c b/src/ic-ioty.c index 2e2ecfe..660b231 100644 --- a/src/ic-ioty.c +++ b/src/ic-ioty.c @@ -336,7 +336,8 @@ int icl_ioty_find_resource(const char *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_COAPS; if (NULL == host_address) { @@ -415,7 +416,8 @@ int icl_ioty_find_device_info(const char *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) @@ -490,7 +492,8 @@ int icl_ioty_find_platform_info(const char *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)