From 50daf6f0ec546ace47f372cbd858473ed97b7d00 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Thu, 7 May 2026 21:25:57 +0200 Subject: [PATCH] MT#61856 sdp.c: use a proper type for port append In `sdp_out_add_media()` the port is given as `unsigned int` but then is being appended to the SDP body as `%i`. Instead the `%u` should actually be used. Same for the `sdp_out_add_osrtp_media()` which treats the `unsigned int` as the `signed` one actually. Change-Id: I6a7a45e9a0daa70ffffd17d2a35ff7db8c8cf7ab --- daemon/sdp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 489fa7162..665ec6cc1 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -3279,7 +3279,7 @@ __attribute__((nonnull(1, 2, 3))) static void sdp_out_add_osrtp_media(GString *out, struct call_media *media, const struct transport_protocol *prtp, const endpoint_t *address) { - g_string_append_printf(out, "m=" STR_FORMAT " %d %s ", + g_string_append_printf(out, "m=" STR_FORMAT " %u %s ", STR_FMT(&media->type), address ? address->port : 0, prtp->name); @@ -3297,12 +3297,12 @@ static bool sdp_out_add_media(GString *out, struct call_media *media, unsigned int port) { if (media->protocol) - g_string_append_printf(out, "m=" STR_FORMAT " %i %s ", + g_string_append_printf(out, "m=" STR_FORMAT " %u %s ", STR_FMT(&media->type), port, media->protocol->name); else if (media->protocol_str.s) - g_string_append_printf(out, "m=" STR_FORMAT " %i " STR_FORMAT " ", + g_string_append_printf(out, "m=" STR_FORMAT " %u " STR_FORMAT " ", STR_FMT(&media->type), port, STR_FMT(&media->protocol_str));