NSRPC: fix heuristic dissector

Do not check reported length but captured length, otherwise it can
can trigger an exception when trying to fetch at offset 4.
Once the (very basic heuristic) is verified, cann the right dissection
function.

Bug: 14399
Change-Id: Ie09d80e04f2501c940693a2ea9ecbd2f84d1e22f
Reviewed-on: https://code.wireshark.org/review/25666
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Pascal Quantin 2018-02-07 18:32:50 +01:00 committed by Michael Mann
parent 22824478d1
commit 80a1dd7029
1 changed files with 2 additions and 2 deletions

View File

@ -1178,7 +1178,7 @@ dissect_ns_rpc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
{
guint16 ns_rpc_sig;
if (tvb_reported_length(tvb) < 6)
if (tvb_captured_length(tvb) < 6)
return FALSE;
/* Get the signature */
@ -1186,7 +1186,7 @@ dissect_ns_rpc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
if (ns_rpc_sig != 0xA5A5)
return FALSE;
dissect_ns_rpc_heur(tvb, pinfo, tree, data);
dissect_ns_rpc(tvb, pinfo, tree, data);
return TRUE;
}