summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-sip.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2013-04-23 22:44:23 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2013-04-23 22:44:23 +0000
commit4ef8ba6324ae7f9d9ce8d94c2f1ba7457e0b9f4c (patch)
tree840cb19aa7888e15e70fa120f4a677d7723cfcea /epan/dissectors/packet-sip.c
parent94d2036ad0247ea1a572bdac54259e93422e0c4f (diff)
downloadwireshark-4ef8ba6324ae7f9d9ce8d94c2f1ba7457e0b9f4c.tar.gz
Add a quick check for a first printable character to avoid a more expensive
check of the whole first line. This gets called a lot as a heuristic dissector. svn path=/trunk/; revision=49006
Diffstat (limited to 'epan/dissectors/packet-sip.c')
-rw-r--r--epan/dissectors/packet-sip.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c
index ea622eeb68..b1d08b2cf7 100644
--- a/epan/dissectors/packet-sip.c
+++ b/epan/dissectors/packet-sip.c
@@ -2118,6 +2118,17 @@ dissect_sip_common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
guint32 response_time = 0;
int strlen_to_copy;
+ /*
+ * If this should be a request of response, do this quick check to see if
+ * it begins with a string...
+ * Otherwise, SIP heuristics are expensive...
+ *
+ */
+ if (!dissect_other_as_continuation &&
+ ((tvb_reported_length_remaining(tvb, offset) < 1) || !isprint(tvb_get_guint8(tvb, offset))))
+ {
+ return -2;
+ }
/*
* Note that "tvb_find_line_end()" will return a value that