summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2024-05-17 14:34:25 +0900
committerJaehyun Kim <jeik01.kim@samsung.com>2024-05-17 14:34:25 +0900
commitaa196e9ff7306c8fcd3ac2dfb1acb865d745e249 (patch)
tree3bb3755a3a5c332733091fe8fdd78fbe3eb4893c
parentc760e02e756e4edb4d0ef21c0d91cd77101c63e8 (diff)
downloadconnman-aa196e9ff7306c8fcd3ac2dfb1acb865d745e249.tar.gz
connman-aa196e9ff7306c8fcd3ac2dfb1acb865d745e249.tar.bz2
connman-aa196e9ff7306c8fcd3ac2dfb1acb865d745e249.zip
Fix crash issue when sending DHCP_FAIL signal
Change-Id: I8b0dfe83c9ed9d1d7b2fc118f88af5e99d77234b Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
-rwxr-xr-xgdhcp/client.c9
-rwxr-xr-xsrc/network.c13
2 files changed, 17 insertions, 5 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c
index 905cecf2..3e7c1f45 100755
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -3388,10 +3388,15 @@ void g_dhcp_client_unref(GDHCPClient *dhcp_client)
g_hash_table_destroy(dhcp_client->send_value_hash);
g_hash_table_destroy(dhcp_client->secs_bcast_hash);
- g_free(dhcp_client);
#if defined TIZEN_EXT
- dhcp_client = NULL;
+ dhcp_client->interface = NULL;
+ dhcp_client->assigned_ip = NULL;
+ dhcp_client->last_address = NULL;
+ dhcp_client->duid = NULL;
+ dhcp_client->server_duid = NULL;
#endif
+
+ g_free(dhcp_client);
}
void g_dhcp_client_set_debug(GDHCPClient *dhcp_client,
diff --git a/src/network.c b/src/network.c
index 69816999..46a4af90 100755
--- a/src/network.c
+++ b/src/network.c
@@ -2140,10 +2140,17 @@ dbus_bool_t __connman_network_notify_dhcp_changed(const char *key, const char *v
DBusMessageIter iter;
dbus_bool_t result = FALSE;
- if (val)
- DBG("key %s, val %s", key, val);
- else
+ if (val) {
+ if (!g_utf8_validate(val, -1, NULL)) {
+ DBG("key %s, invalid val", key);
+ val = "";
+ } else {
+ DBG("key %s, val %s", key, val);
+ }
+ } else {
DBG("key %s, val NULL", key);
+ val = "";
+ }
signal = dbus_message_new_signal(CONNMAN_MANAGER_PATH,
CONNMAN_MANAGER_INTERFACE, "DhcpChanged");