ANSI IS-637-A: fix dissection of fragmented Unicode SMS
The computation of the number of characters available was wrong when the User Data Header is present Change-Id: I2809c1460316530654a997b26cfc33c60a32fd6f Reviewed-on: https://code.wireshark.org/review/4284 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
db277bc749
commit
e520b2b800
|
@ -972,10 +972,13 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
|
||||||
|
|
||||||
case 0x05:
|
case 0x05:
|
||||||
str = "Shift-JIS";
|
str = "Shift-JIS";
|
||||||
|
encoding_bit_len = 8;
|
||||||
|
cset = OTHER;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x06:
|
case 0x06:
|
||||||
str = "Korean";
|
str = "Korean";
|
||||||
|
encoding_bit_len = 8;
|
||||||
cset = OTHER;
|
cset = OTHER;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1045,6 +1048,7 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
|
||||||
{
|
{
|
||||||
gsm_sms_udh_fields_t udh_fields;
|
gsm_sms_udh_fields_t udh_fields;
|
||||||
gint32 num_udh_bits;
|
gint32 num_udh_bits;
|
||||||
|
guint8 ud_length;
|
||||||
|
|
||||||
memset(&udh_fields, 0, sizeof(udh_fields));
|
memset(&udh_fields, 0, sizeof(udh_fields));
|
||||||
|
|
||||||
|
@ -1078,9 +1082,16 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
|
||||||
|
|
||||||
offset = 0;
|
offset = 0;
|
||||||
fill_bits = 0;
|
fill_bits = 0;
|
||||||
dis_field_udh(tvb_out, tree, &offset, &required_octs, &num_fields, cset, &fill_bits, &udh_fields);
|
ud_length = num_fields;
|
||||||
|
if (encoding_bit_len == 16) {
|
||||||
|
/* the NUM_FIELD value represents the number of characters in Unicode encoding.
|
||||||
|
Let's translate it into bytes */
|
||||||
|
ud_length <<= 1;
|
||||||
|
}
|
||||||
|
dis_field_udh(tvb_out, tree, &offset, &required_octs, &ud_length, cset, &fill_bits, &udh_fields);
|
||||||
|
|
||||||
offset = saved_offset;
|
offset = saved_offset;
|
||||||
|
num_fields = ud_length;
|
||||||
|
|
||||||
if (encoding_bit_len == 7)
|
if (encoding_bit_len == 7)
|
||||||
{
|
{
|
||||||
|
@ -1113,6 +1124,9 @@ tele_param_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} else if (encoding_bit_len == 16) {
|
||||||
|
/* compute the number of Unicode characters now that UDH is taken into account */
|
||||||
|
num_fields >>= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (udh_fields.frags > 0)
|
if (udh_fields.frags > 0)
|
||||||
|
|
Loading…
Reference in New Issue