MT#60476 sdp_create: fix crash on zero stream

It's been noticed that trying to print a zero
conneciton address, on the media stream, which
actually offered non-zeroed IP source, but a
zero port, leads to a segmentation fault,
because it relies in this case on presented
`sockaddr_t` information, which is actually absent.

This happens only with sdp_create on offer/answer.
Test fixed is "a=mid on zero streams".

Change-Id: Ic2f7f671c9ded9b361d6467ca013698fdff28538
rfuchs/test
Donat Zenichev 8 months ago
parent 150ee6dbde
commit 2757a71dac

@ -3688,7 +3688,7 @@ static void sdp_out_add_media_connection(GString *out, struct call_media *media,
const char *media_conn_address_type = NULL;
/* print zeroed address */
if (PS_ISSET(rtp_ps, ZERO_ADDR) && !MEDIA_ISSET(media, ICE)) {
if (!address || (PS_ISSET(rtp_ps, ZERO_ADDR) && !MEDIA_ISSET(media, ICE))) {
if (!address) {
const struct intf_address *ifa_addr;
const struct local_intf *ifa;

Loading…
Cancel
Save