From ab02931d764c5ce9d15b646bcb2d064ebd061ae1 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 27 Jun 2025 08:29:40 -0400 Subject: [PATCH] MT#55283 fix sdes_accept logic booboo Using `l->next` as a test for whether only one element is left in the list is not reliable. Use the actual list length instead. Update one affected test. Closes #1961 Change-Id: I5773715700220cd762e61090bac941ddd33afd9b (cherry picked from commit 02897ccb46ec45c3b7022ecc99f9fc095fe3cfa0) (cherry picked from commit 5b973780631f145cea520b7378b50c2af7f0cbec) --- daemon/call.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index c9db51e25..1477c65da 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1866,10 +1866,8 @@ static void __sdes_accept(struct call_media *media, const struct sdp_ng_flags *f /* stop the iteration intentionally, if only one suite is left * this helps with a case, when the offerer left with no suites, * which can be allowed, but we need to still have at least something */ - if (g_list_length(l) == 1) { - l = l->prev; + if (media->sdes_in.length == 1) break; - } ilogs(crypto, LOG_DEBUG, "Dropping offered crypto suite '%s' from offer due to %s", offered_cps->params.crypto_suite->name,