webrtc_data_channel: Fix use-after-free issue 77/316277/2
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Aug 2024 02:08:52 +0000 (11:08 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Aug 2024 03:22:40 +0000 (12:22 +0900)
[Version] 1.1.26
[Issue Type] ASAN defect

Change-Id: Idae9729c00520ca6aa55655fb795c0c9175ed6c0
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_data_channel.c

index 5e0c51a2b08d5bbd5a084a7a957da2cff4417b2c..6d034e7e8400007a5fd749441d103a5a7da1fd74 100644 (file)
@@ -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
index 524073282b88969a7bffe33dd4be65213b821edb..a14b5dedfea7ca36cb61554f8a9597c3215d7158 100644 (file)
@@ -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;
 }