From 1a2d96d4b346393022cff6c327e72aad6f4122b3 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 14 Mar 2023 08:39:00 +0100 Subject: [PATCH] MT#56128 SDP manipulations: CMD_REM check emptiness of attribute Do not proceed to the `g_hash_table_lookup()` if the `attr_name` is empty. Additonally: improve slightly the same check for the CMD_SUBST. Change-Id: I39e34c34b458150ebae38dff5e6a46f6e8f17c66 --- daemon/sdp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index ea6ccc291..9fdfef674 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -324,7 +324,7 @@ static int sdp_manipulate_check(enum command_type command_type, case CMD_SUBST:; q_ptr = NULL; - if (!attr_name) + if (!attr_name || !attr_name->len) break; struct sdp_substitute_attr fictitious = {attr_name, NULL}; @@ -361,6 +361,10 @@ static int sdp_manipulate_check(enum command_type command_type, case CMD_REM:; GHashTable *ht = NULL; + + if (!attr_name || !attr_name->len) + break; + switch (media_type) { case MT_AUDIO: ht = sdp_manipulations->rem_commands_audio;