Skip to content

Commit

Permalink
NFS: do not use reported remaining length as the backing length
Browse files Browse the repository at this point in the history
Otherwise it could throw an exception if captured length < reported length

Change-Id: Ia9eb2778dbfebc1865a0040020a62ba20882b482
Reviewed-on: https://code.wireshark.org/review/8804
Reviewed-by: Pascal Quantin <[email protected]>
  • Loading branch information
pquantin committed Jun 7, 2015
1 parent ad0b29c commit e9c9473
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epan/dissectors/packet-nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,8 +2186,8 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
proto_tree_add_uint(tree, hf_nfs_fh_decode_as, tvb, offset, 0, default_nfs_fhandle_type);

real_length = fhlen;
if (default_nfs_fhandle_type != FHT_UNKNOWN && real_length < tvb_reported_length_remaining(tvb, offset))
real_length = tvb_reported_length_remaining(tvb, offset);
if (default_nfs_fhandle_type != FHT_UNKNOWN && real_length < tvb_captured_length_remaining(tvb, offset))
real_length = tvb_captured_length_remaining(tvb, offset);

fh_tvb = tvb_new_subset(tvb, offset, real_length, fhlen);
if (!dissector_try_uint(nfs_fhandle_table, default_nfs_fhandle_type, fh_tvb, pinfo, tree))
Expand Down

0 comments on commit e9c9473

Please sign in to comment.