ieee1722: use payload_length only when it's valid.
Bug: 16241 Change-Id: If9e08fef649830dfed48a53d2d1cad983b7ca090 Reviewed-on: https://code.wireshark.org/review/35263 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
d4ca6cc550
commit
f17f127760
|
@ -2832,16 +2832,17 @@ static int dissect_1722_acf_lin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
|
||||||
col_add_fstr(pinfo->cinfo, COL_INFO, "ACF-LIN(%u): 0x%02x ", bus_id, lin_id);
|
col_add_fstr(pinfo->cinfo, COL_INFO, "ACF-LIN(%u): 0x%02x ", bus_id, lin_id);
|
||||||
|
|
||||||
payload_length = tvb_reported_length_remaining(tvb, offset) - pad_length;
|
payload_length = tvb_reported_length_remaining(tvb, offset) - pad_length;
|
||||||
col_append_str(pinfo->cinfo, COL_INFO, tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, payload_length, ' '));
|
|
||||||
|
|
||||||
if (payload_length < 0 || payload_length > 8)
|
if (payload_length < 0 || payload_length > 8)
|
||||||
{
|
{
|
||||||
expert_add_info(pinfo, ti_lin, &ei_1722_lin_invalid_payload_length);
|
expert_add_info(pinfo, ti_lin, &ei_1722_lin_invalid_payload_length);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (payload_length > 0)
|
else if (payload_length > 0)
|
||||||
{
|
{
|
||||||
tvbuff_t* next_tvb = tvb_new_subset_length(tvb, offset, payload_length);
|
tvbuff_t* next_tvb = tvb_new_subset_length(tvb, offset, payload_length);
|
||||||
|
|
||||||
|
col_append_str(pinfo->cinfo, COL_INFO, tvb_bytes_to_str_punct(wmem_packet_scope(), tvb, offset, payload_length, ' '));
|
||||||
|
|
||||||
/* at the moment, there's no global LIN sub-protocols support. Use our own. */
|
/* at the moment, there's no global LIN sub-protocols support. Use our own. */
|
||||||
if (dissector_try_payload_new(avb1722_acf_lin_dissector_table, next_tvb, pinfo, tree, TRUE, &lin_id) <= 0)
|
if (dissector_try_payload_new(avb1722_acf_lin_dissector_table, next_tvb, pinfo, tree, TRUE, &lin_id) <= 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue