Unverified Commit 7c8491ba authored by Sébastien Blin's avatar Sébastien Blin
Browse files

pjproject: fix crash in pj_turn_session_on_rx_pkt2()

Instead of letting the TURN session destroy itself when finished, the current
code is overriding the user_data attached to the session. This is not needed
because the turn session will be stopped when the timer will complete and
this can cause some crashes in pj_turn_session_on_rx_pkt2 because the data
is erased while not protected via turn_sock->grp_lock() (mostly in turn_sock.c,
on_data_read)

Change-Id: Ia4a12917711b5534b372cb3a26e9141e5393c569
Gitlab: #299
parent 3f598a6a
pjnath/src/pjnath/turn_sock.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/pjnath/src/pjnath/turn_sock.c b/pjnath/src/pjnath/turn_sock.c
index a6e192e9f..3fc65aa75 100644
--- a/pjnath/src/pjnath/turn_sock.c
+++ b/pjnath/src/pjnath/turn_sock.c
@@ -1396,9 +1396,6 @@ static void turn_on_state(pj_turn_session *sess,
if (new_state >= PJ_TURN_STATE_DESTROYING && turn_sock->sess) {
pj_time_val delay = {0, 0};
- turn_sock->sess = NULL;
- pj_turn_session_set_user_data(sess, NULL);
-
pj_timer_heap_cancel_if_active(turn_sock->cfg.timer_heap,
&turn_sock->timer, 0);
pj_timer_heap_schedule_w_grp_lock(turn_sock->cfg.timer_heap,
......@@ -16,7 +16,8 @@
"0001-win-config.patch",
"0002-win-vs-gnutls.patch",
"0003-win-vs2017-props.patch",
"0011-fix-tcp-death-detection.patch"
"0011-fix-tcp-death-detection.patch",
"0012-fix-turn-shutdown-crash.patch"
],
"project_paths": [
"pjlib-util/build/pjlib_util.vcxproj",
......
......@@ -56,6 +56,7 @@ pjproject: pjproject-$(PJPROJECT_VERSION).tar.gz .sum-pjproject
$(APPLY) $(SRC)/pjproject/0009-add-config-site.patch
$(APPLY) $(SRC)/pjproject/0010-fix-pkgconfig.patch
$(APPLY) $(SRC)/pjproject/0011-fix-tcp-death-detection.patch
$(APPLY) $(SRC)/pjproject/0012-fix-turn-shutdown-crash.patch
ifdef HAVE_ANDROID
$(APPLY) $(SRC)/pjproject/0001-android.patch
endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment