diff options
author | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2009-01-21 11:12:36 +0000 |
---|---|---|
committer | Martin Mathieson <martin.r.mathieson@googlemail.com> | 2009-01-21 11:12:36 +0000 |
commit | e06e1ad944e57213ba626075e4df9390fb55a485 (patch) | |
tree | e68e376c00a6ed59c7203754a576579af66530cc /epan | |
parent | c2c8a2f409b4e90493a889132004716dc75ba49e (diff) |
Be more careful about the length of the last SDU or padding in a PDU.
svn path=/trunk/; revision=27283
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-mac-lte.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index a5a62423ad..d3891bd4ed 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -846,7 +846,9 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree ulsch_lcid_vals : dlsch_lcid_vals, "Unknown"), - pdu_lengths[n]); + (pdu_lengths[n] == -1) ? + tvb_length_remaining(tvb, offset) : + pdu_lengths[n]); offset += pdu_lengths[n]; } else { @@ -894,7 +896,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree tvb, offset, 1, FALSE); if (reserved != 0) { expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, - "Power Headeroom Reserved bits not zero (found 0x%x)", reserved); + "Power Headroom Reserved bits not zero (found 0x%x)", reserved); } } @@ -933,7 +935,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree case PADDING_LCID: /* No payload, unless its the last subheader, in which case it extends to the end of the PDU */ - if (n == (number_of_headers-1)) { + if ((n == (number_of_headers-1)) && tvb_length_remaining(tvb, offset) > 0) { proto_tree_add_item(tree, hf_mac_lte_padding_data, tvb, offset, -1, FALSE); } |