forked from osmocom/wireshark
bencode: Fix for truncated packets
Some applications emits improper bencode packets (w/o terminating 'e' - they erroneously imply that EOF can be considered as a end-of-dictionary). Let's not fail while parsing these packets. Change-Id: Ib650e246c7f56b40ef07227eb0dd175a30e4d3a9 Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This commit is contained in:
parent
bc96d375ab
commit
da2cdf7a39
|
@ -226,7 +226,7 @@ static int dissect_bencoding_rec(tvbuff_t *tvb, packet_info *pinfo,
|
|||
length -= op1len + op2len;
|
||||
}
|
||||
|
||||
proto_tree_add_item(dtree, hf_bencode_truncated_data, tvb, offset + used, -1, ENC_NA);
|
||||
proto_tree_add_item(dtree, hf_bencode_truncated_data, tvb, offset + used, length ? -1 : 0, ENC_NA);
|
||||
return -1;
|
||||
|
||||
case 'l':
|
||||
|
|
Loading…
Reference in New Issue