aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-06-12 02:42:11 +0800
committerHarald Welte <laforge@gnumonks.org>2009-06-12 02:42:11 +0800
commit3cfdb222143d8b1d746e5b807f604afe49853f7d (patch)
treea83164768d21fbd75fded0d1020ce3150d623853 /openbsc
parentb89550764aac8b1f4b97734cc5451931a34c249d (diff)
SMS: fix parsing of destination phone number
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gsm_04_11.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 85ff4641..3d5820d6 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -186,11 +186,12 @@ static int gsm340_rx_tpdu(struct msgb *msg)
rc = -EIO;
goto out;
}
+ memset(address_lv, 0, sizeof(address_lv));
memcpy(address_lv, smsp, da_len_bytes);
/* mangle first byte to reflect length in bytes, not digits */
- address_lv[0] = da_len_bytes;
+ address_lv[0] = da_len_bytes - 1;
/* convert to real number */
- decode_bcd_number(sms->dest_addr, sizeof(sms->dest_addr), address_lv, 0);
+ decode_bcd_number(sms->dest_addr, sizeof(sms->dest_addr), address_lv, 1);
smsp += da_len_bytes;