From: Jiwan Kim Date: Tue, 13 Jun 2017 07:22:55 +0000 (+0900) Subject: Fix svace issues X-Git-Tag: submit/tizen/20170828.225740~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=29528a5c2f5a625abe450b3767a6e52bdd3a552c;p=platform%2Fcore%2Fapi%2Fwifi-mesh.git Fix svace issues --- diff --git a/src/mesh.c b/src/mesh.c index 3c43dbc..bade637 100644 --- a/src/mesh.c +++ b/src/mesh.c @@ -70,7 +70,7 @@ EXPORT_API int mesh_network_clone(mesh_network_h* dst, mesh_network_h src) net->rssi = _src->rssi; net->data_rate = _src->data_rate; net->security = _src->security; - if (_src->passphrase) + if (strlen(_src->passphrase) > 0) snprintf(net->passphrase, MAX_PASSPHRASE_LEN, "%s", _src->passphrase); *dst = (mesh_network_h)net; diff --git a/src/mesh_dbus.c b/src/mesh_dbus.c index 838ecd4..7e3bdd9 100644 --- a/src/mesh_dbus.c +++ b/src/mesh_dbus.c @@ -76,11 +76,15 @@ static void _dbus_name_owner_notify(GObject *object, GParamSpec *pspec, gchar *name_owner = g_dbus_proxy_get_name_owner(proxy); mesh_h handle = (mesh_h)user_data; + LOGD("Name owner notify [%s]", name_owner); + if (name_owner) return; - LOGE("name_owner is not exists !"); - _mesh_close_gdbus_call(handle); + if (NULL == name_owner) + _mesh_close_gdbus_call(handle); + + g_free(name_owner); } static int _mesh_create_gdbus_call(mesh_h handle) diff --git a/test/menu.c b/test/menu.c index 7dfab33..e3a38d3 100644 --- a/test/menu.c +++ b/test/menu.c @@ -349,7 +349,7 @@ static void _hex_dump(const char *pad, int size, const void *data) snprintf(buf, 255, "%s%04X: ", pad, 0); for (i = 0; i < size; i++) { snprintf(hex, 4, "%02X ", p[i]); - strncat(buf, hex, strlen(hex)); + strncat(buf, hex, 255 - strlen(buf) - 1); if ((i + 1) % 8 == 0) { if ((i + 1) % 16 == 0) { @@ -357,7 +357,7 @@ static void _hex_dump(const char *pad, int size, const void *data) memset(buf, 0, 255); snprintf(buf, 255, "%s%04X: ", pad, i + 1); } else { - strncat(buf, TAB_SPACE, strlen(TAB_SPACE)); + strncat(buf, TAB_SPACE, 255 - strlen(buf) - 1); } } }