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 02897ccb46)
mr13.4
Richard Fuchs 5 months ago
parent 9861a7b384
commit 8bd62e1830

@ -1957,10 +1957,8 @@ static void __sdes_accept(struct call_media *media, const sdp_ng_flags *flags) {
/* 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 (l->next == NULL) {
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,

@ -1418,7 +1418,7 @@ c=IN IP4 203.0.113.1
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtcp:PORT
a=crypto:4 AES_256_CM_HMAC_SHA1_32 inline:CRYPTO256
a=crypto:3 AES_256_CM_HMAC_SHA1_80 inline:CRYPTO256
SDP

Loading…
Cancel
Save