From e98c635391752ab615efcc0369d200887d953829 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 9 Jun 2010 15:29:13 +0200 Subject: [SMS] Properly reject processing of compressed SMS As we don't support compressed SMS, we have to properly reject it. In the existing code, we segfaulted at some later point since the error handling was incomplete. This was triggered by some obscure STK SIM card that insisted on sending a compressed SMS after registering to the OpenBSC network. --- openbsc/src/gsm_04_11.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'openbsc/src/gsm_04_11.c') diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c index f84463c6f..82c4084c2 100644 --- a/openbsc/src/gsm_04_11.c +++ b/openbsc/src/gsm_04_11.c @@ -369,9 +369,11 @@ enum sms_alphabet gsm338_get_sms_alphabet(u_int8_t dcs) enum sms_alphabet alpha = DCS_NONE; if ((cgbits & 0xc) == 0) { - if (cgbits & 2) + if (cgbits & 2) { LOGP(DSMS, LOGL_NOTICE, "Compressed SMS not supported yet\n"); + return 0xffffffff; + } switch ((dcs >> 2)&0x03) { case 0: @@ -551,6 +553,8 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m gsms->data_coding_scheme = *smsp++; sms_alphabet = gsm338_get_sms_alphabet(gsms->data_coding_scheme); + if (sms_alphabet == 0xffffffff) + return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; switch (sms_vpf) { case GSM340_TP_VPF_RELATIVE: -- cgit v1.2.3