All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ussd: Fix crash with long ussd string
@ 2012-03-30 13:16 Nicolas Bertrand
  2012-03-30  6:38 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Bertrand @ 2012-03-30 13:16 UTC (permalink / raw)
  To: ofono

[-- 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-30 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 13:16 [PATCH] ussd: Fix crash with long ussd string Nicolas Bertrand
2012-03-30  6:38 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.