From 3a26e893623658981bc8c22860f513faad738747 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Sat, 27 Sep 2008 14:16:55 +0000 Subject: From Reinhard(rspmn): Wrong display of USSD strings in the GSM 7-bit alphabet for non-ASCII data svn path=/trunk/; revision=26286 --- asn1/gsmmap/gsmmap.cnf | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'asn1') diff --git a/asn1/gsmmap/gsmmap.cnf b/asn1/gsmmap/gsmmap.cnf index 471300a223..0202674671 100644 --- a/asn1/gsmmap/gsmmap.cnf +++ b/asn1/gsmmap/gsmmap.cnf @@ -418,8 +418,10 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; guint8 out_len; /* XXX - The maximum item label length is 240. Does this really need to be 1024? * use ep_alloc ? + * We need a input and an output buffer to gsm_sms_char_ascii_decode() */ - static unsigned char bigbuf[1024]; + static unsigned char msgbuf[1024]; + static unsigned char outbuf[1024]; gchar *utf8_text = NULL; GIConv cd; GError *l_conv_error = NULL; @@ -432,14 +434,14 @@ actx->pinfo->p2p_dir = P2P_DIR_RECV; switch(sms_encoding){ case SMS_ENCODING_7BIT: case SMS_ENCODING_7BIT_LANG: - out_len = gsm_sms_char_7bit_unpack(0, length, sizeof(bigbuf), + out_len = gsm_sms_char_7bit_unpack(0, length, sizeof(msgbuf), tvb_get_ptr(parameter_tvb, 0, length), - bigbuf); + msgbuf); - bigbuf[out_len] = '\0'; - gsm_sms_char_ascii_decode(bigbuf, bigbuf, out_len); - bigbuf[1023] = '\0'; - proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %%s", bigbuf); + msgbuf[out_len] = '\0'; + gsm_sms_char_ascii_decode(outbuf, msgbuf, out_len); + msgbuf[1023] = '\0'; + proto_tree_add_text(tree, parameter_tvb, 0, length, "USSD String: %%s", outbuf); break; case SMS_ENCODING_8BIT: proto_tree_add_text(tree, parameter_tvb , 0, length, "USSD String: %%s", tvb_get_ptr(parameter_tvb, 0, length)); -- cgit v1.2.3