aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2013-04-02 21:13:02 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2013-04-02 21:13:02 +0000
commitee5c5e93612f6b9b875cfe8736bf738242c3c11f (patch)
tree9101994fc9188ddf1c9a2325a6b3f5a603cf25dc
parent432e914dbd43c3ee354aa1eeff8f2dc750913f0e (diff)
Both tvb_length_remaining and tvb_reported_length_remaining can return -1.
#BACKPORT(1.6,1.8 ... manually as other occurrences are in those trunks) svn path=/trunk/; revision=48710
-rw-r--r--epan/dissectors/packet-btavdtp.c8
-rw-r--r--epan/dissectors/packet-dvmrp.c2
-rw-r--r--epan/dissectors/packet-enrp.c4
-rw-r--r--epan/dissectors/packet-image-png.c2
-rw-r--r--epan/dissectors/packet-m2tp.c2
-rw-r--r--epan/dissectors/packet-sbc.c2
-rw-r--r--epan/dissectors/packet-usb-hid.c2
7 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-btavdtp.c b/epan/dissectors/packet-btavdtp.c
index 7390e681d7..aae85ae0a6 100644
--- a/epan/dissectors/packet-btavdtp.c
+++ b/epan/dissectors/packet-btavdtp.c
@@ -480,7 +480,7 @@ dissect_sep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
guint32 t_frame_number;
items = tvb_length_remaining(tvb, offset) / 2;
- while (tvb_length_remaining(tvb, offset)) {
+ while (tvb_length_remaining(tvb, offset) > 0) {
seid = tvb_get_guint8(tvb, offset);
in_use = seid & 0x02;
seid = seid >> 2;
@@ -714,7 +714,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
*codec = -1;
}
- while (tvb_length_remaining(tvb, offset)) {
+ while (tvb_length_remaining(tvb, offset) > 0) {
service_category = tvb_get_guint8(tvb, offset);
losc = tvb_get_guint8(tvb, offset + 1);
service_item = proto_tree_add_text(capabilities_tree, tvb, offset, 2 + losc, "Service: %s", val_to_str_const(service_category, service_category_vals, "RFD"));
@@ -1221,7 +1221,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SIGNAL_ID_START:
if (message_type == MESSAGE_TYPE_COMMAND) {
i_sep = 1;
- while (tvb_length_remaining(tvb, offset)) {
+ while (tvb_length_remaining(tvb, offset) > 0) {
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset, SEID_ACP, i_sep, NULL);
i_sep += 1;
}
@@ -1246,7 +1246,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case SIGNAL_ID_SUSPEND:
if (message_type == MESSAGE_TYPE_COMMAND) {
i_sep = 1;
- while (tvb_length_remaining(tvb, offset)) {
+ while (tvb_length_remaining(tvb, offset) > 0) {
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset, SEID_ACP, i_sep, NULL);
i_sep += 1;
}
diff --git a/epan/dissectors/packet-dvmrp.c b/epan/dissectors/packet-dvmrp.c
index 471705c18f..2fd819b416 100644
--- a/epan/dissectors/packet-dvmrp.c
+++ b/epan/dissectors/packet-dvmrp.c
@@ -539,7 +539,7 @@ dissect_dvmrp_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
offset += 2;
/* decode all the v1 commands */
- while (tvb_reported_length_remaining(tvb, offset)) {
+ while (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree *tree;
proto_item *item;
guint8 cmd,count;
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index b3c06fd215..82f15d5797 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -232,7 +232,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);
@@ -715,7 +715,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-image-png.c b/epan/dissectors/packet-image-png.c
index d9c592475b..4305ec3e81 100644
--- a/epan/dissectors/packet-image-png.c
+++ b/epan/dissectors/packet-image-png.c
@@ -232,7 +232,7 @@ dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *da
proto_tree_add_item(tree, hf_png_signature, tvb, offset, 8, ENC_NA);
offset+=8;
- while(tvb_reported_length_remaining(tvb, offset)){
+ while(tvb_reported_length_remaining(tvb, offset) > 0){
proto_tree *chunk_tree=NULL;
proto_item *it=NULL;
guint32 len, type;
diff --git a/epan/dissectors/packet-m2tp.c b/epan/dissectors/packet-m2tp.c
index 767912300d..14339b0a3f 100644
--- a/epan/dissectors/packet-m2tp.c
+++ b/epan/dissectors/packet-m2tp.c
@@ -511,7 +511,7 @@ dissect_m2tp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2tp
offset += COMMON_HEADER_LENGTH;
/* extract zero or more parameters and process them individually */
- while(tvb_reported_length_remaining(message_tvb, offset)) {
+ while(tvb_reported_length_remaining(message_tvb, offset) > 0) {
length = tvb_get_ntohs(message_tvb, offset + PARAMETER_LENGTH_OFFSET);
padding_length = nr_of_padding_bytes(length);
total_length = length + padding_length;
diff --git a/epan/dissectors/packet-sbc.c b/epan/dissectors/packet-sbc.c
index 4680ffcf73..f9f5cc22d2 100644
--- a/epan/dissectors/packet-sbc.c
+++ b/epan/dissectors/packet-sbc.c
@@ -139,7 +139,7 @@ dissect_sbc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
number_of_frames = tvb_get_guint8(tvb, offset) & 0x0F;
offset += 1;
- while (tvb_length_remaining(tvb, offset)) {
+ while (tvb_length_remaining(tvb, offset) > 0) {
byte = tvb_get_guint8(tvb, offset + 1);
frequency = (byte & 0xC0) >> 6;
blocks = (byte & 0x30) >> 4;
diff --git a/epan/dissectors/packet-usb-hid.c b/epan/dissectors/packet-usb-hid.c
index 82c62ccacf..2dbf8b8366 100644
--- a/epan/dissectors/packet-usb-hid.c
+++ b/epan/dissectors/packet-usb-hid.c
@@ -455,7 +455,7 @@ dissect_usb_hid_report_item(packet_info *pinfo _U_, proto_tree *parent_tree, tvb
struct usb_hid_global_state cur_global;
memcpy(&cur_global, global, sizeof(struct usb_hid_global_state));
- while (tvb_reported_length_remaining(tvb, offset))
+ while (tvb_reported_length_remaining(tvb, offset) > 0)
{
old_offset=offset;