From 39635c7e678f840e493c9e92118e41f043150554 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Mon, 29 Apr 2019 19:33:08 -0400
Subject: [PATCH] ice: avoid segfault when ice session doesn't exist anymore

Change-Id: Ib4ede6e0c9eb8d1985d2f0273c98cbfd0433b0ba
---
 contrib/src/pjproject/rfc6544.patch | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/src/pjproject/rfc6544.patch b/contrib/src/pjproject/rfc6544.patch
index b8b5cd1515..0e8ac3348b 100644
--- a/contrib/src/pjproject/rfc6544.patch
+++ b/contrib/src/pjproject/rfc6544.patch
@@ -1376,7 +1376,7 @@ index c51dba771..b96390613 100644
  	    c->state == PJ_ICE_SESS_CHECK_STATE_WAITING)
  	{
 diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c
-index 54ef8ba69..21be04bfe 100644
+index 54ef8ba69..f2d0aa5ed 100644
 --- a/pjnath/src/pjnath/ice_strans.c
 +++ b/pjnath/src/pjnath/ice_strans.c
 @@ -69,6 +69,7 @@ enum tp_type
@@ -2140,14 +2140,14 @@ index 54ef8ba69..21be04bfe 100644
 +    return;
 +  }
 +  data = (sock_user_data *)pj_stun_sock_get_user_data(stun_sock);
-+  if (data == NULL) {
++  if (!data) {
 +    /* We have disassociated ourselves from the STUN socket */
 +    return;
 +  }
 +
 +  comp = data->comp;
 +  ice_st = comp->ice_st;
-+  if (ice_st == NULL) {
++  if (!ice_st || !ice_st->ice) {
 +	  // Incorrect ICE
 +	  return;
 +  }
-- 
GitLab