summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon/icd-dbus.c2
-rw-r--r--daemon/icd-ioty-ocprocess.c1
-rw-r--r--daemon/icd-payload.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/daemon/icd-dbus.c b/daemon/icd-dbus.c
index 57b2a63..b16f619 100644
--- a/daemon/icd-dbus.c
+++ b/daemon/icd-dbus.c
@@ -92,7 +92,7 @@ int icd_dbus_client_list_get_resource_info(OCResourceHandle handle,
rsrc_handle = cur_hd->data;
if (rsrc_handle->handle == handle) {
- DBG("signal_number(%u) for resource handle(%u) found",
+ DBG("signal_number(%x) for resource handle(%p) found",
rsrc_handle->signal_number, handle);
*signal_number = rsrc_handle->signal_number;
*bus_name = ic_utils_strdup(client->bus_name);
diff --git a/daemon/icd-ioty-ocprocess.c b/daemon/icd-ioty-ocprocess.c
index 235bc1c..e992a3e 100644
--- a/daemon/icd-ioty-ocprocess.c
+++ b/daemon/icd-ioty-ocprocess.c
@@ -455,6 +455,7 @@ static int _worker_find_cb(void *context)
struct icd_find_context *ctx = context;
RETV_IF(NULL == ctx, IOTCON_ERROR_INVALID_PARAMETER);
+ RETV_IF(NULL == ctx->payload, IOTCON_ERROR_INVALID_PARAMETER);
for (i = 0; ctx->payload[i]; i++) {
value = g_variant_new("(vi)", ctx->payload[i], ctx->conn_type);
diff --git a/daemon/icd-payload.c b/daemon/icd-payload.c
index 003566e..8d8377f 100644
--- a/daemon/icd-payload.c
+++ b/daemon/icd-payload.c
@@ -64,7 +64,7 @@ GVariant** icd_payload_res_to_gvariant(OCPayload *payload, OCDevAddr *dev_addr)
res_count = OCDiscoveryPayloadGetResourceCount(discovered);
- value = calloc(res_count, sizeof(GVariant*));
+ value = calloc(res_count + 1, sizeof(GVariant*));
if (NULL == value) {
ERR("calloc() Fail(%d)", errno);
return NULL;