aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-10-16 15:24:47 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2018-10-16 15:35:59 +0200
commitddcfad58070fb7a573dc8ef629d59e126b0307a0 (patch)
tree177c5d8e244b4b463b76aa78fe5a4b4cf835f5f6
parente484d42bf2bdbc4e4add056a6564faa7c856e46b (diff)
gsm0808: allow decoding of zero length speech codec lists.pmaier/test_16102018
3GPP_TS_48.008, 3.2.2.103 Speech Codec List states the following: "The length indicator (octet 2) is a binary number indicating the absolute length of the contents after the length indicator. The length depends on the number and type of Speech Codec Elements to be included. The minimum length of one Speech Codec Element is 1 octet and the maximum length is 3 octets. The maximum number of Speech Codec Elements within the Speech Codec List is not defined." This clearly refers only to the length of a single speech codec element but not on the overall list. So speech codec lists with length 0 are indeed permitted by the spec. - Remove the assertion that checks on zero length speech codec lists. Change-Id: I1eb1f4466b98bdd26d765b0e4cc690b5e89e9dd6 Related: OS#3657
-rw-r--r--src/gsm/gsm0808_utils.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 886f546a..6be874bd 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -349,9 +349,6 @@ uint8_t gsm0808_enc_speech_codec_list(struct msgb *msg,
OSMO_ASSERT(msg);
OSMO_ASSERT(scl);
- /* Empty list */
- OSMO_ASSERT(scl->len >= 1);
-
msgb_put_u8(msg, GSM0808_IE_SPEECH_CODEC_LIST);
tlv_len = msgb_put(msg, 1);
old_tail = msg->tail;
@@ -404,11 +401,6 @@ int gsm0808_dec_speech_codec_list(struct gsm0808_speech_codec_list *scl,
scl->len = decoded;
- /* Empty list */
- if (decoded < 1) {
- return -EINVAL;
- }
-
return (int)(elem - old_elem);
}