From 1725c92cb10c1ef1de4a0954ea8dd9cc328198f9 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Wed, 4 Oct 2023 09:39:06 +0200 Subject: [PATCH] MT#58441 Improve attribute level appends Improve attribute level append functions: - `append_attr_to_gstring()` - `append_attr_int_to_gstring()` Add a check against `sdp_manipulations_subst()` additionally to already existing `sdp_manipulate_remove()`. Change-Id: I8f1a68c3cdadffe5f43fa02373c5fba5c89dc239 --- daemon/sdp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 90e9407ef..9054d0b47 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2830,8 +2830,10 @@ static void append_attr_to_gstring(GString *s, char * name, const str * value, str attr = STR_INIT(name); struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, media_type); /* take into account SDP arbitrary manipulations */ - if (sdp_manipulate_remove(sdp_manipulations, &attr)) { - ilog(LOG_DEBUG, "Cannot insert: '%s' because prevented by SDP manipulations", name); + if (sdp_manipulate_remove(sdp_manipulations, &attr) || + sdp_manipulations_subst(sdp_manipulations, &attr)) + { + ilog(LOG_DEBUG, "Cannot insert: '%s' because prevented by SDP manipulations (remove or subst)", name); return; } /* attr name */ @@ -2853,8 +2855,10 @@ static void append_attr_int_to_gstring(GString *s, char * name, const int * valu str attr = STR_INIT(name); struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, media_type); /* take into account SDP arbitrary manipulations */ - if (sdp_manipulate_remove(sdp_manipulations, &attr)) { - ilog(LOG_DEBUG, "Cannot insert: '%s' because prevented by SDP manipulations", name); + if (sdp_manipulate_remove(sdp_manipulations, &attr) || + sdp_manipulations_subst(sdp_manipulations, &attr)) + { + ilog(LOG_DEBUG, "Cannot insert: '%s' because prevented by SDP manipulations (remove or subst)", name); return; } /* attr name */