From 64fd7b8c1c070c3aff7e6cf84de65d74f4e04b86 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 19 Jan 2024 08:27:23 -0500 Subject: [PATCH] MT#55283 restore some flags null checks These can actually be null in some cases. Change-Id: I73a047638420189947a41edf0d725c488c990ad2 Warned-by: Coverity --- daemon/call.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index aac3e96ed..28b38e5fb 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -933,7 +933,7 @@ static int __num_media_streams(struct call_media *media, unsigned int num_ports) return ret; } -__attribute__((nonnull(1, 2, 4, 5))) +__attribute__((nonnull(1, 2, 4))) static void __fill_stream(struct packet_stream *ps, const struct endpoint *epp, unsigned int port_off, const struct stream_params *sp, const sdp_ng_flags *flags) { @@ -982,7 +982,8 @@ static void __fill_stream(struct packet_stream *ps, const struct endpoint *epp, } /* endpont-learning setup */ - ps->el_flags = flags->el_option; + if (flags) + ps->el_flags = flags->el_option; if (ps->selected_sfd) ilog(LOG_DEBUG, "set FILLED flag for stream, local %s remote %s%s%s", @@ -993,9 +994,9 @@ static void __fill_stream(struct packet_stream *ps, const struct endpoint *epp, FMT_M(endpoint_print_buf(&ps->endpoint))); PS_SET(ps, FILLED); - if (flags->pierce_nat) + if (flags && flags->pierce_nat) PS_SET(ps, PIERCE_NAT); - if (flags->nat_wait) + if (flags && flags->nat_wait) PS_SET(ps, NAT_WAIT); }