From: Sangchul Lee Date: Mon, 19 Aug 2024 02:08:52 +0000 (+0900) Subject: webrtc_data_channel: Fix use-after-free issue X-Git-Tag: accepted/tizen/unified/20240821.081515~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=433a0dd46cd24937729d61098d4466cd3f76fae5;p=platform%2Fcore%2Fapi%2Fwebrtc.git webrtc_data_channel: Fix use-after-free issue [Version] 1.1.26 [Issue Type] ASAN defect Change-Id: Idae9729c00520ca6aa55655fb795c0c9175ed6c0 Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index 5e0c51a2..6d034e7e 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: 1.1.25 +Version: 1.1.26 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_data_channel.c b/src/webrtc_data_channel.c index 52407328..a14b5ded 100644 --- a/src/webrtc_data_channel.c +++ b/src/webrtc_data_channel.c @@ -247,9 +247,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; }