diff options
author | Anders Broman <anders.broman@ericsson.com> | 2007-11-09 06:01:18 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2007-11-09 06:01:18 +0000 |
commit | 622603589393ddd44656437f2e323c7fecf1c362 (patch) | |
tree | 874c9902e9d5e87aeda6b3c11e76dd35b41312f0 /epan/dissectors/packet-smb2.c | |
parent | 29cf34d1c2fa3d56559fd08cfa4bc5616f9cbf14 (diff) |
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
Diffstat (limited to 'epan/dissectors/packet-smb2.c')
-rw-r--r-- | epan/dissectors/packet-smb2.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |