diff options
author | Jaehyun Kim <jeik01.kim@samsung.com> | 2024-05-17 14:34:25 +0900 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2024-05-17 14:34:25 +0900 |
commit | aa196e9ff7306c8fcd3ac2dfb1acb865d745e249 (patch) | |
tree | 3bb3755a3a5c332733091fe8fdd78fbe3eb4893c | |
parent | c760e02e756e4edb4d0ef21c0d91cd77101c63e8 (diff) | |
download | connman-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-x | gdhcp/client.c | 9 | ||||
-rwxr-xr-x | src/network.c | 13 |
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"); |