From 622603589393ddd44656437f2e323c7fecf1c362 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Fri, 9 Nov 2007 06:01:18 +0000 Subject: Apply yet another set of the optimization patches: When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length(). On the other hand if (tvb_bytes_exist(tvb, 0, 20) is more readable than if (tvb_length(tvb) >= 20 so only do it in heuristic function svn path=/trunk/; revision=23412 --- epan/dissectors/packet-smb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'epan/dissectors/packet-smb2.c') diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index e65fdb6aa4..4666f10aa3 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -4560,7 +4560,7 @@ dissect_smb2_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) int offset = 0; /* must check that this really is a smb2 packet */ - if (!tvb_bytes_exist(tvb, 0, 4)) + if (tvb_length(tvb) < 4) return FALSE; if( (tvb_get_guint8(tvb, 0) != 0xfe) -- cgit v1.2.3