diff --git a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c index 93c0c230ee..b417a2e704 100644 --- a/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c +++ b/libs/sofia-sip/libsofia-sip-ua/sdp/sdp.c @@ -1244,6 +1244,8 @@ int sdp_connection_cmp(sdp_connection_t const *a, sdp_connection_t const *b) if ((a != NULL) != (b != NULL)) return (a != NULL) < (b != NULL) ? -1 : 1; + if (!a || !b) + return -1; if (a->c_nettype != b->c_nettype) return a->c_nettype < b->c_nettype ? -1 : 1; if (a->c_addrtype != b->c_addrtype)