From 9e78f64ea221bd7f9d30ccd20cd23d884f8938d8 Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Mon, 19 Aug 2024 11:08:52 +0900 Subject: [PATCH] webrtc_data_channel: Fix use-after-free issue (cherry-picked from tizen branch) [Version] 0.3.305 [Issue Type] ASAN defect Change-Id: Idae9729c00520ca6aa55655fb795c0c9175ed6c0 Signed-off-by: Sangchul Lee --- packaging/capi-media-webrtc.spec | 2 +- src/webrtc_data_channel.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index d1d151d5..55aaa404 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.3.304 +Version: 0.3.305 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_data_channel.c b/src/webrtc_data_channel.c index ba9e19db..288fbd2a 100644 --- a/src/webrtc_data_channel.c +++ b/src/webrtc_data_channel.c @@ -252,9 +252,9 @@ int _destroy_data_channel(webrtc_data_channel_s *channel) RET_VAL_IF(channel == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "channel is NULL"); RET_VAL_IF(channel->from_remote, WEBRTC_ERROR_INVALID_PARAMETER, "do not destroy a data channel obtained from _on_data_channel_cb()"); - g_hash_table_remove(channel->webrtc->data_channels, channel); + LOG_INFO("data channel[%p, object:%p] will be destroyed", channel, channel->channel); - LOG_INFO("data channel[%p, object:%p] is destroyed", channel, channel->channel); + g_hash_table_remove(channel->webrtc->data_channels, channel); return WEBRTC_ERROR_NONE; } -- 2.34.1