From 6de3d6cbaed00cfcee2f8b4b73d60957b2a72ce0 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Tue, 22 Aug 2023 13:08:24 +0200 Subject: csd_bs_list_to_gsm0808_ct: assert -> ret -EINVAL Instead of asserting on an empty list of bearer services, return -EINVAL. This makes the function more similar to sdp_audio_codecs_to_gsm0808_channel_type which also doesn't assert if an empty list of codecs is passed. Related: OS#4394 Change-Id: I15a389e1f7a9d3d17b6531c9836d3d5f9d148267 --- src/libmsc/csd_bs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libmsc/csd_bs.c b/src/libmsc/csd_bs.c index 3a2c82a4e..caea057de 100644 --- a/src/libmsc/csd_bs.c +++ b/src/libmsc/csd_bs.c @@ -382,7 +382,8 @@ int csd_bs_list_to_gsm0808_channel_type(struct gsm0808_channel_type *ct, const s .ch_indctr = GSM0808_CHAN_DATA, }; - OSMO_ASSERT(list->count); + if (!list->count) + return -EINVAL; if (csd_bs_is_transp(list->bs[0])) { ct->data_transparent = true; -- cgit v1.2.3