aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-04-10 17:11:24 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2018-04-11 04:29:17 +0000
commit526a328d839cebf8d52dfcfdd479f12e83a28d3a (patch)
tree1ec66b16bc96b088b49d080312b71a1c2b798ab1
parentb8861933094ddd6ec9d366648186efab8a1ab0cb (diff)
NBSS: take into account snaplen when creating the TVB subset
Otherwise you can trigger an exception interrupting the packet dissection when the snaplen defined is shorter than the payload length Bug: 14598 Change-Id: Ibeb6482495ed67c7669574bdcd7c429523318428 Reviewed-on: https://code.wireshark.org/review/26858 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
-rw-r--r--epan/dissectors/packet-nbt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nbt.c b/epan/dissectors/packet-nbt.c
index 67fda0b278..a45b9a7041 100644
--- a/epan/dissectors/packet-nbt.c
+++ b/epan/dissectors/packet-nbt.c
@@ -1669,10 +1669,7 @@ dissect_nbss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
* Construct a tvbuff containing the amount of the payload we have
* available. Make its reported length the amount of data in the PDU.
*/
- length = length_remaining;
- if (length > plen)
- length = plen;
- next_tvb = tvb_new_subset_length_caplen(tvb, offset, length, plen);
+ next_tvb = tvb_new_subset_length(tvb, offset, plen);
dissect_nbss_packet(next_tvb, pinfo, tree, is_cifs);