diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-11-15 21:22:01 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-11-15 21:22:01 +0000 |
commit | e0586f7d2f0676e57c804d5abcf0d115c901799a (patch) | |
tree | c20416a4c04507b9ea39334e8d5aa697fcd28d58 /epan/dissectors | |
parent | 07ffd03cbcca3e32d36cdea3aeba27896a3d42aa (diff) |
tvb_[reported_]length_remaining can return -1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39870 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-aim-generic.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-aim.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ajp13.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-asap.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-mp2t.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-scsi.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-uts.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-v52.c | 2 |
8 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-aim-generic.c b/epan/dissectors/packet-aim-generic.c index 0ffe7c58d6..2db6903cbf 100644 --- a/epan/dissectors/packet-aim-generic.c +++ b/epan/dissectors/packet-aim-generic.c @@ -385,7 +385,7 @@ static int dissect_aim_generic_evil(tvbuff_t *tvb, packet_info *pinfo, proto_tre { int offset = 0; proto_tree_add_item(gen_tree, hf_generic_evil_new_warn_level, tvb, offset, 2, ENC_BIG_ENDIAN); - while(tvb_length_remaining(tvb, offset)) { + while(tvb_length_remaining(tvb, offset) > 0) { offset = dissect_aim_userinfo(tvb, pinfo, offset, gen_tree); } return offset; diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index adf165ecb6..013bbac742 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -772,7 +772,7 @@ dissect_aim_snac(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_item_append_text(ti, ", %s", subtype->name); } - if(tvb_length_remaining(tvb, offset) > 0 && subtype != NULL && subtype->dissector) + if((tvb_length_remaining(tvb, offset) > 0) && (subtype != NULL) && subtype->dissector) { subtype->dissector(subtvb, pinfo, family_tree); } diff --git a/epan/dissectors/packet-ajp13.c b/epan/dissectors/packet-ajp13.c index 9b5570d0d7..0739031a50 100644 --- a/epan/dissectors/packet-ajp13.c +++ b/epan/dissectors/packet-ajp13.c @@ -703,7 +703,7 @@ display_req_forward(tvbuff_t *tvb, packet_info *pinfo, /* ATTRIBUTES */ - while(tvb_reported_length_remaining(tvb, pos)) { + while(tvb_reported_length_remaining(tvb, pos) > 0) { guint8 aid; const gchar* aname = NULL; const gchar* aval; diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c index 9def8ee305..40ba7147f4 100644 --- a/epan/dissectors/packet-asap.c +++ b/epan/dissectors/packet-asap.c @@ -226,7 +226,7 @@ dissect_error_causes(tvbuff_t *error_causes_tvb, proto_tree *parameter_tree) tvbuff_t *error_cause_tvb; offset = 0; - while(tvb_reported_length_remaining(error_causes_tvb, offset)) { + while(tvb_reported_length_remaining(error_causes_tvb, offset) > 0) { length = tvb_get_ntohs(error_causes_tvb, offset + CAUSE_LENGTH_OFFSET); total_length = ADD_PADDING(length); error_cause_tvb = tvb_new_subset(error_causes_tvb, offset , total_length, total_length); @@ -722,7 +722,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree) tvbuff_t *parameter_tvb; offset = 0; - while((remaining_length = tvb_length_remaining(parameters_tvb, offset))) { + while((remaining_length = tvb_length_remaining(parameters_tvb, offset)) > 0) { length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET); total_length = ADD_PADDING(length); if (remaining_length >= length) diff --git a/epan/dissectors/packet-mp2t.c b/epan/dissectors/packet-mp2t.c index 85a45d9460..45bc8b6146 100644 --- a/epan/dissectors/packet-mp2t.c +++ b/epan/dissectors/packet-mp2t.c @@ -1066,7 +1066,7 @@ heur_dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) if (tvb_length_remaining(tvb, offset) % MP2T_PACKET_SIZE) { return FALSE; } else { - while (tvb_length_remaining(tvb, offset)) { + while (tvb_length_remaining(tvb, offset) > 0) { if (tvb_get_guint8(tvb, offset) != MP2T_SYNC_BYTE) return FALSE; offset += MP2T_PACKET_SIZE; diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index 9be5a61064..977f7449f4 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -2664,7 +2664,7 @@ dissect_scsi_blockdescs (tvbuff_t *tvb, packet_info *pinfo _U_, if (!cdata) return; - while (tvb_length_remaining(tvb, offset)) { + while (tvb_length_remaining(tvb, offset) > 0) { if (longlba) { if(tvb_length_remaining(tvb, offset)<8) return; diff --git a/epan/dissectors/packet-uts.c b/epan/dissectors/packet-uts.c index 0c90b334a5..b3aefeda62 100644 --- a/epan/dissectors/packet-uts.c +++ b/epan/dissectors/packet-uts.c @@ -241,7 +241,7 @@ dissect_uts(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree) } } - while (tvb_length_remaining(tvb, offset)) { /* now look for the ETX */ + while (tvb_length_remaining(tvb, offset) > 0) { /* now look for the ETX */ if ((tvb_get_guint8(tvb, offset) & 0x7f) == ETX) { if (header_length == -1) header_length = offset; /* the header ends at an STX, or if not found, the ETX */ diff --git a/epan/dissectors/packet-v52.c b/epan/dissectors/packet-v52.c index 1fb1f03679..fa9455b230 100644 --- a/epan/dissectors/packet-v52.c +++ b/epan/dissectors/packet-v52.c @@ -1942,7 +1942,7 @@ dissect_v52_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /*int old_offset;*/ int singleoctet; - while(tvb_length_remaining(tvb,offset)){ + while(tvb_length_remaining(tvb,offset) > 0){ singleoctet = 0; /* old_offset = offset; */ info_element = tvb_get_guint8(tvb, offset); |