aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_04_11.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-06-09 15:29:13 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-09 21:40:45 +0800
commite98c635391752ab615efcc0369d200887d953829 (patch)
tree9a2cb74398c0926de358e413870680167f9455a3 /openbsc/src/gsm_04_11.c
parent5bfe499366c86e2e30c1ae1a47706b13fab0dd87 (diff)
[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.
Diffstat (limited to 'openbsc/src/gsm_04_11.c')
-rw-r--r--openbsc/src/gsm_04_11.c6
1 files changed, 5 insertions, 1 deletions
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: