Use tvb_new_subset_length() rather than tvb_new_subset().

We rarely, if ever, want to, or need to, explicitly set the captured
length of a packet; we want to set the *reported* length and let the
tvbuff code figure out how much of that data was actually captured.

Change-Id: I9b93d296197989f677d888b10954589dfc1edc59
Reviewed-on: https://code.wireshark.org/review/4138
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-09-16 14:30:16 -07:00
parent 1cbd9c7955
commit b5296f465e
1 changed files with 1 additions and 1 deletions

View File

@ -2403,7 +2403,7 @@ proto_tree_add_protocol_format(proto_tree *tree, int hfindex, tvbuff_t *tvb,
pi = proto_tree_add_pi(tree, hfinfo, tvb, start, &length);
proto_tree_set_protocol_tvb(PNODE_FINFO(pi), (start == 0 ? tvb : tvb_new_subset(tvb, start, length, length)));
proto_tree_set_protocol_tvb(PNODE_FINFO(pi), (start == 0 ? tvb : tvb_new_subset_length(tvb, start, length)));
TRY_TO_FAKE_THIS_REPR(pi);