diff options
author | Oliver Smith <osmith@sysmocom.de> | 2023-08-22 13:08:24 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2023-08-23 16:42:24 +0200 |
commit | 6de3d6cbaed00cfcee2f8b4b73d60957b2a72ce0 (patch) | |
tree | c94a63660bd68099df3a5f2e83a8014a774b4dc3 | |
parent | e355d948f853db2c011baea787a313e649821417 (diff) |
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
-rw-r--r-- | src/libmsc/csd_bs.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |