From 8e527b4148f1627f4df1a0440eeee2a945c1ff28 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 28 May 2026 20:56:45 +0200 Subject: [PATCH] MT#61856 call_interfaces: `call_transform_ng()` add iteration guards When iterating through medias, check whether there is something in; - `->streams.head` - `->selected_sfd` - `->socket.local.address.family` before to blidnly appeal to it. If transform setup can ever produce incomplete media, this might crash while building the response. Change-Id: Ie75f20b111634ee3faa0af58c1eebfddbbcc843e --- daemon/call_interfaces.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index abb2abc11..adf52544a 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -2512,8 +2512,14 @@ const char *call_transform_ng(ng_command_ctx_t *ctx) { __auto_type m = l->data; parser_arg dict = parser->list_add_dict(list); parser->dict_add_str_dup(dict, "id", &m->media_id); + if (!m->streams.head) + continue; __auto_type ps = m->streams.head->data; + if (!ps->selected_sfd) + continue; __auto_type sfd = ps->selected_sfd; + if (!sfd->socket.local.address.family) + continue; parser->dict_add_str(dict, "family", STR_PTR(sfd->socket.local.address.family->rfc_name)); parser->dict_add_str_dup(dict, "address", STR_PTR(sockaddr_print_buf(&sfd->socket.local.address))); parser->dict_add_int(dict, "port", sfd->socket.local.port);