Open Source Telephony
 help / color / mirror / Atom feed
From: Nicolas Bertrand <nicolas.bertrand@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH] ussd: Fix crash with long ussd string
Date: Fri, 30 Mar 2012 15:16:36 +0200	[thread overview]
Message-ID: <1333113396-1158-1-git-send-email-nicolas.bertrand@linux.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Some ZTE modem convert USSD string into UCS2 without respecting
the limitation of 160 bytes. So cut off the string if greater than
this limit
---
 drivers/atmodem/ussd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 443251a..bdee2d9 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -158,7 +158,7 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
 
 	case SMS_CHARSET_8BIT:
 	case SMS_CHARSET_UCS2:
-		msg_ptr = decode_hex_own_buf(content, -1, &msg_len, 0, msg);
+		msg_ptr = decode_hex_own_buf(content, 320, &msg_len, 0, msg);
 		break;
 	}
 
-- 
1.7.5.4


             reply	other threads:[~2012-03-30 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 13:16 Nicolas Bertrand [this message]
2012-03-30  6:38 ` [PATCH] ussd: Fix crash with long ussd string Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333113396-1158-1-git-send-email-nicolas.bertrand@linux.intel.com \
    --to=nicolas.bertrand@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox