From 7e5a5e665b3d0c845cec21804c3c87ba8421de7c Mon Sep 17 00:00:00 2001 From: Aki Niemi Date: Mon, 27 Sep 2010 15:49:16 +0300 Subject: [PATCH] isimodem: Fix CBS decoding --- drivers/isimodem/cbs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/isimodem/cbs.c b/drivers/isimodem/cbs.c index 186ba700..0d7fc8a7 100644 --- a/drivers/isimodem/cbs.c +++ b/drivers/isimodem/cbs.c @@ -71,7 +71,15 @@ static void routing_ntf_cb(GIsiClient *client, if (!msg || len < 3 || msg[0] != SMS_GSM_CB_ROUTING_NTF) return; - ofono_cbs_notify(cbs, msg+5, len-5); + /* Skipping header(s) */ + msg += 5; + len -= 5; + + /* + * The next 88 bytes of the sub-block are the actual CBS PDU, + * followed by an informational data length field, and filler. + */ + ofono_cbs_notify(cbs, msg, len - 2); } static gboolean routing_resp_cb(GIsiClient *client,