From f37f41ccb2126ad9f32bb1214bf58aaef9518b00 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Sat, 17 Feb 2018 15:34:33 +0300 Subject: [PATCH] FS-9753: [mod_sofia] Fix crash when accessing the WSS interface via regular HTTPS --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/tport/tport.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 5b7da58dcf..0b779c7ab1 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Jun 26 14:53:11 CDT 2017 +Wed Feb 21 13:55:11 CDT 2018 diff --git a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c index 29e5cb0399..286de1a91e 100644 --- a/libs/sofia-sip/libsofia-sip-ua/tport/tport.c +++ b/libs/sofia-sip/libsofia-sip-ua/tport/tport.c @@ -1059,7 +1059,9 @@ int tport_register_secondary(tport_t *self, su_wakeup_f wakeup, int events) self->tp_index = i; self->tp_events = events; - tprb_append(&self->tp_pri->pri_open, self); + /* Can't be added to list of opened if already closed */ + if (!tport_is_closed(self)) + tprb_append(&self->tp_pri->pri_open, self); return 0; } @@ -2627,7 +2629,9 @@ int tport_accept(tport_primary_t *pri, int events) SU_CANONIZE_SOCKADDR(su); - if (/* Name this transport */ + if (/* Prevent being marked as connected if already closed */ + !tport_is_closed(self) && + /* Name this transport */ tport_setname(self, pri->pri_protoname, ai, NULL) != -1 /* Register this secondary */ &&