NFS: do not use reported remaining length as the backing length

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 <pascal.quantin@gmail.com>
This commit is contained in:
Pascal Quantin 2015-06-07 12:04:28 +02:00
parent ad0b29c44b
commit e9c94731f6
1 changed files with 2 additions and 2 deletions

View File

@ -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))