aboutsummaryrefslogtreecommitdiffstats
path: root/doc/packet-PROTOABBREV.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-02-22 14:16:44 -0500
committerEvan Huus <eapache@gmail.com>2014-02-23 15:30:35 +0000
commit83fc3468532ee7a033b66b3a2d3511b568a1d38c (patch)
treee96aadacc024726cd686199bfe4ea007751e36e5 /doc/packet-PROTOABBREV.c
parent41fc5a53e9d645b9a089f57c08679a6d2bf766b5 (diff)
Documentation updates
Change-Id: I6bd7fa40726fe7ffd68b9341c640874f2a0f1c7c Reviewed-on: https://code.wireshark.org/review/314 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Christopher Maynard <Christopher.Maynard@gtech.com> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'doc/packet-PROTOABBREV.c')
-rw-r--r--doc/packet-PROTOABBREV.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/doc/packet-PROTOABBREV.c b/doc/packet-PROTOABBREV.c
index c1aaba8d36..b1fedfec41 100644
--- a/doc/packet-PROTOABBREV.c
+++ b/doc/packet-PROTOABBREV.c
@@ -96,17 +96,20 @@ dissect_PROTOABBREV(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* For example:
*/
- /* Check that there's enough data */
+ /* Check that the packet is long enough for it to belong to us */
if (tvb_reported_length(tvb) < PROTOABBREV_MIN_LENGTH)
return 0;
- /* Fetch some values from the packet header using tvb_get_*(). If these
- * values are not valid/possible in your protocol then return 0 to give
- * some other dissector a chance to dissect it.
- */
- if ( TEST_HEURISTICS )
- /* these values are not possible in PROTONAME */
- return 0;
+ /* Check that there's enough data present to run the heuristics */
+ if (tvb_captured_length(tvb) > SOME_HEURISTIC_VALUE) {
+ /* Fetch some values from the packet header using tvb_get_*(). If these
+ * values are not valid/possible in your protocol then return 0 to give
+ * some other dissector a chance to dissect it.
+ */
+ if ( TEST_HEURISTICS )
+ /* these values are not possible in PROTONAME */
+ return 0;
+ }
/*** COLUMN DATA ***/