diff options
-rw-r--r-- | epan/dissectors/packet-clnp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-cpha.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-dcp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ddtp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-enip.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-epmd.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-etheric.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-extreme.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-gdsdb.c | 66 | ||||
-rw-r--r-- | epan/dissectors/packet-ipsec.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-kerberos.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-l2tp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ldp.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-mdshdr.c | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-mpls-echo.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-ndps.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-olsr.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-smb-pipe.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-tapa.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-xot.c | 2 |
20 files changed, 63 insertions, 63 deletions
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c index 256b066b74..670bbe5bcc 100644 --- a/epan/dissectors/packet-clnp.c +++ b/epan/dissectors/packet-clnp.c @@ -1952,7 +1952,7 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) or not - set the Info column now; we'll get an exception before we set it otherwise. */ - if (!tvb_bytes_exist(tvb, 0, cnf_hdr_len)) { + if (tvb_length(tvb) < cnf_hdr_len) { if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "%s NPDU %s", pdu_type_string, flag_string); } diff --git a/epan/dissectors/packet-cpha.c b/epan/dissectors/packet-cpha.c index c1693b9931..861d0d972c 100644 --- a/epan/dissectors/packet-cpha.c +++ b/epan/dissectors/packet-cpha.c @@ -199,7 +199,7 @@ dissect_cpha(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * If the magic number or protocol version is unknown, don't treat this * frame as a CPHA frame. */ - if (!tvb_bytes_exist(tvb, 0, 4)) { + if (tvb_length(tvb) < 4) { /* Not enough data for the magic number or protocol version */ return 0; } diff --git a/epan/dissectors/packet-dcp.c b/epan/dissectors/packet-dcp.c index cec47499c3..df2e63f694 100644 --- a/epan/dissectors/packet-dcp.c +++ b/epan/dissectors/packet-dcp.c @@ -576,7 +576,7 @@ static void dissect_dcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) e_dcphdr *dcph; /* get at least a full message header */ - if(!tvb_bytes_exist(tvb, 0, DCCP_HDR_LEN_MIN)) { + if(tvb_length(tvb) < DCCP_HDR_LEN_MIN) { /* DBG("malformed\n"); */ if (tree) proto_tree_add_boolean_hidden(dcp_tree, hf_dcp_malformed, tvb, offset, 0, TRUE); @@ -626,7 +626,7 @@ static void dissect_dcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dcph->x=tvb_get_guint8(tvb, offset+8)&0x01; /* DBG("dcph->x: %d\n", dcph->x); */ if(dcph->x) { - if(!tvb_bytes_exist(tvb, 0, DCCP_HDR_LEN)) { /* at least 16 bytes */ + if(tvb_length(tvb) < DCCP_HDR_LEN) { /* at least 16 bytes */ /* DBG("malformed\n"); */ proto_tree_add_boolean_hidden(dcp_tree, hf_dcp_malformed, tvb, offset, 0, TRUE); THROW(ReportedBoundsError); @@ -934,7 +934,7 @@ static void dissect_dcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) return; } - if(!tvb_bytes_exist(tvb, 0, advertised_dccp_header_len)) { + if(tvb_length(tvb) < advertised_dccp_header_len) { if(tree) proto_tree_add_text(dcp_tree, tvb, offset, -1, "too short packet: missing %d bytes of DCCP header", advertised_dccp_header_len - tvb_reported_length_remaining(tvb, offset)); diff --git a/epan/dissectors/packet-ddtp.c b/epan/dissectors/packet-ddtp.c index faed30b82e..235c5229ab 100644 --- a/epan/dissectors/packet-ddtp.c +++ b/epan/dissectors/packet-ddtp.c @@ -97,7 +97,7 @@ dissect_ddtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * If we don't recognize the version number, don't dissect this. */ - if (tvb_bytes_exist(tvb, 0, 4)) { + if (tvb_length(tvb) >= 4) { if (match_strval(tvb_get_ntohl(tvb, 0), vals_ddtp_version) == NULL) return 0; } diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index 3ce7246721..5a29f02709 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -719,7 +719,7 @@ dissect_enip_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) g_tree = tree; /* An ENIP packet is at least 4 bytes long - we need the command type. */ - if (!tvb_bytes_exist(tvb, 0, 4)) + if (tvb_length(tvb) < 4) return 0; /* Get the command type and see if it's valid. */ @@ -739,7 +739,7 @@ dissect_enip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) g_tree = tree; /* An ENIP packet is at least 4 bytes long - we need the command type. */ - if (!tvb_bytes_exist(tvb, 0, 4)) + if (tvb_length(tvb) < 4) return 0; /* Get the command type and see if it's valid. */ diff --git a/epan/dissectors/packet-epmd.c b/epan/dissectors/packet-epmd.c index 67ec854280..1a6b5f28df 100644 --- a/epan/dissectors/packet-epmd.c +++ b/epan/dissectors/packet-epmd.c @@ -191,7 +191,7 @@ check_epmd(tvbuff_t *tvb) * It's possible to start checking lengths but imho that * doesn't bring very much. */ - if (!tvb_bytes_exist(tvb, 0, 3)) + if (tvb_length(tvb) < 3) return(FALSE); type = tvb_get_guint8(tvb, 0); diff --git a/epan/dissectors/packet-etheric.c b/epan/dissectors/packet-etheric.c index 216c8c31b8..a17de3f5af 100644 --- a/epan/dissectors/packet-etheric.c +++ b/epan/dissectors/packet-etheric.c @@ -315,7 +315,7 @@ dissect_etheric(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Do we have the version number? */ - if (!tvb_bytes_exist(tvb, 0, 1)) { + if (tvb_length(tvb) < 1) { /* No - reject this packet. */ return 0; } diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c index b544310e37..87fe2572bb 100644 --- a/epan/dissectors/packet-extreme.c +++ b/epan/dissectors/packet-extreme.c @@ -1002,7 +1002,7 @@ dissect_edp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * If we have the entire ESP packet available, check the checksum. */ - if (tvb_bytes_exist(tvb, 0, data_length)) { + if (tvb_length(tvb) >= data_length) { /* Checksum from version to null tlv */ cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, data_length); cksum_vec[0].len = data_length; diff --git a/epan/dissectors/packet-gdsdb.c b/epan/dissectors/packet-gdsdb.c index 6da692aab0..4f0fddedb7 100644 --- a/epan/dissectors/packet-gdsdb.c +++ b/epan/dissectors/packet-gdsdb.c @@ -420,7 +420,7 @@ gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_item *ti; proto_tree *pref_tree; - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (check_col(pinfo->cinfo, COL_INFO)){ @@ -488,7 +488,7 @@ gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -509,7 +509,7 @@ gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } if (tree) { @@ -533,7 +533,7 @@ gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) int offset; int length; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } if (check_col(pinfo->cinfo, COL_INFO)){ @@ -564,7 +564,7 @@ gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } if (tree) { @@ -584,7 +584,7 @@ gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } if (tree) { @@ -622,7 +622,7 @@ gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } if (tree) { @@ -652,7 +652,7 @@ gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) int offset; int length; - if (!tvb_bytes_exist(tvb, 0, 32)) { + if (tvb_length(tvb) < 32) { return 0; } if (tree) { @@ -680,7 +680,7 @@ gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } if (tree) { @@ -701,7 +701,7 @@ gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) int offset; - if (!tvb_bytes_exist(tvb, 0, 8)) { + if (tvb_length(tvb) < 8) { return 0; } if (tree) { @@ -743,7 +743,7 @@ gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { int offset; - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -763,7 +763,7 @@ gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -780,7 +780,7 @@ gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -796,7 +796,7 @@ gdsdb_reconnect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 12)) { + if (tvb_length(tvb) < 12) { return 0; } if (tree) { @@ -813,7 +813,7 @@ gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) int length; guint opcode; - if (!tvb_bytes_exist(tvb, 0, 20)) { + if (tvb_length(tvb) < 20) { return 0; } @@ -845,7 +845,7 @@ gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -863,7 +863,7 @@ gdsdb_release(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 8)) { + if (tvb_length(tvb) < 8) { return 0; } if (tree) { @@ -879,7 +879,7 @@ gdsdb_prepare2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 12)) { + if (tvb_length(tvb) < 12) { return 0; } if (tree) { @@ -895,7 +895,7 @@ gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 24)) { + if (tvb_length(tvb) < 24) { return 0; } if (tree) { @@ -913,7 +913,7 @@ gdsdb_cancel_events(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 12)) { + if (tvb_length(tvb) < 12) { return 0; } if (tree) { @@ -928,7 +928,7 @@ gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -945,7 +945,7 @@ gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 24)) { + if (tvb_length(tvb) < 24) { return 0; } if (tree) { @@ -963,7 +963,7 @@ gdsdb_slice_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 8)) { + if (tvb_length(tvb) < 8) { return 0; } if (tree) { @@ -978,7 +978,7 @@ gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 12)) { + if (tvb_length(tvb) < 12) { return 0; } if (tree) { @@ -996,7 +996,7 @@ gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 44)) { + if (tvb_length(tvb) < 44) { return 0; } if (tree) { @@ -1016,7 +1016,7 @@ gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) int offset; int length; - if (!tvb_bytes_exist(tvb, 0, 32)) { + if (tvb_length(tvb) < 32) { return 0; } if (check_col(pinfo->cinfo, COL_INFO)){ @@ -1056,7 +1056,7 @@ gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -1073,7 +1073,7 @@ gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 12)) { + if (tvb_length(tvb) < 12) { return 0; } if (tree) { @@ -1089,7 +1089,7 @@ gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 12)) { + if (tvb_length(tvb) < 12) { return 0; } if (tree) { @@ -1105,7 +1105,7 @@ gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -1122,7 +1122,7 @@ gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 16)) { + if (tvb_length(tvb) < 16) { return 0; } if (tree) { @@ -1138,7 +1138,7 @@ gdsdb_sql_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { /* int offset; */ - if (!tvb_bytes_exist(tvb, 0, 8)) { + if (tvb_length(tvb) < 8) { return 0; } if (tree) { @@ -1249,7 +1249,7 @@ dissect_gdsdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) gdsdb_tree = NULL; /* So the opcode functions can check on if(tree) */ nopi.cinfo = NULL; - if (!tvb_bytes_exist(tvb, 0, 4)) + if (tvb_length(tvb) < 4) return 0; opcode = tvb_get_ntohl(tvb, 0); diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c index 6636d9b441..567096c22e 100644 --- a/epan/dissectors/packet-ipsec.c +++ b/epan/dissectors/packet-ipsec.c @@ -1663,7 +1663,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(get_address_ok) { /* Get the SPI */ - if(tvb_bytes_exist(tvb, 0, 4)) + if (tvb_length(tvb) >= 4) { spi = tvb_get_ntohl(tvb, 0); } @@ -2268,7 +2268,7 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Handler to free the Decrypted Data Buffer. */ tvb_set_free_cb(tvb_decrypted,g_free); - + if(tvb_bytes_exist(tvb_decrypted, 0, esp_iv_len)) { if(esp_iv_len > 0) diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c index ead7d111b8..eb6edbbeb1 100644 --- a/epan/dissectors/packet-kerberos.c +++ b/epan/dissectors/packet-kerberos.c @@ -4339,7 +4339,7 @@ dissect_kerberos_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) All krb5 commands start with an APPL tag and thus is >=0x60 so if first byte is <=16 just blindly assume it is krb4 then */ - if(tvb_bytes_exist(tvb, 0, 1) && tvb_get_guint8(tvb, 0)<=0x10){ + if(tvb_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){ if(krb4_handle){ gboolean res; diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c index 060874e383..55eb72b42e 100644 --- a/epan/dissectors/packet-l2tp.c +++ b/epan/dissectors/packet-l2tp.c @@ -1699,7 +1699,7 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * as they might not be L2TP packets even though they happen * to be coming from or going to the L2TP port. */ - if (!tvb_bytes_exist(tvb, 0, 2)) + if (tvb_length(tvb) < 2) return 0; /* not enough information to check */ control = tvb_get_ntohs(tvb, 0); switch (L2TP_VERSION(control)) { diff --git a/epan/dissectors/packet-ldp.c b/epan/dissectors/packet-ldp.c index b382fdec3d..9a38d47b22 100644 --- a/epan/dissectors/packet-ldp.c +++ b/epan/dissectors/packet-ldp.c @@ -2393,7 +2393,7 @@ dissect_ldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * packets that happen to be going to or from the * LDP port but that aren't LDP packets. */ - if (!tvb_bytes_exist(tvb, 0, 2)) { + if (tvb_length(tvb) < 2) { /* * Not enough information to tell. */ diff --git a/epan/dissectors/packet-mdshdr.c b/epan/dissectors/packet-mdshdr.c index e3e44f4520..263381fd87 100644 --- a/epan/dissectors/packet-mdshdr.c +++ b/epan/dissectors/packet-mdshdr.c @@ -159,8 +159,8 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti_main, *ti_hdr, *ti_trlr; proto_tree *mdshdr_tree_main, *mdshdr_tree_hdr, *mdshdr_tree_trlr; - int offset = 0, - pktlen; + int offset = 0; + guint pktlen; tvbuff_t *next_tvb; guint8 sof, eof; guint16 vsan; @@ -180,7 +180,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) span_id = (tvb_get_ntohs (tvb, offset+MDSHDR_VSAN_OFFSET) & 0xF000) >> 12; /* The Mdshdr trailer is at the end of the frame */ - if (tvb_bytes_exist (tvb, 0, MDSHDR_HEADER_SIZE + pktlen)) { + if (tvb_length (tvb) >= MDSHDR_HEADER_SIZE + pktlen) { trailer_start = MDSHDR_HEADER_SIZE + pktlen - MDSHDR_TRAILER_SIZE; eof = tvb_get_guint8 (tvb, trailer_start); @@ -243,7 +243,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) MDSHDR_SIZE_BYTE, span_id); /* Add Mdshdr Trailer part */ - if (tvb_bytes_exist (tvb, 0, MDSHDR_HEADER_SIZE+pktlen)) { + if (tvb_length (tvb) >= MDSHDR_HEADER_SIZE + pktlen) { ti_trlr = proto_tree_add_text (mdshdr_tree_main, tvb, trailer_start, MDSHDR_TRAILER_SIZE, "MDS Trailer"); @@ -257,7 +257,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* If this protocol has a sub-dissector call it here, see section 1.8 */ - if (tvb_bytes_exist (tvb, 0, MDSHDR_HEADER_SIZE+pktlen)) { + if (tvb_length (tvb) >= MDSHDR_HEADER_SIZE + pktlen) { next_tvb = tvb_new_subset (tvb, MDSHDR_HEADER_SIZE, pktlen, pktlen); } else { diff --git a/epan/dissectors/packet-mpls-echo.c b/epan/dissectors/packet-mpls-echo.c index 767efd512e..5846e820cf 100644 --- a/epan/dissectors/packet-mpls-echo.c +++ b/epan/dissectors/packet-mpls-echo.c @@ -945,7 +945,7 @@ dissect_mpls_echo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) const guint8 *ts_sent, *ts_rec; /* If version != 1 we assume it's not an mpls ping packet */ - if (!tvb_bytes_exist(tvb, 0, 5)) { + if (tvb_length(tvb) < 5) { return; /* Not enough information to tell version and message type. */ } if (tvb_get_ntohs(tvb, 0) != 1) { diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c index 51188c5fb8..32f43650ce 100644 --- a/epan/dissectors/packet-ndps.c +++ b/epan/dissectors/packet-ndps.c @@ -4338,7 +4338,7 @@ dissect_ndps_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) static void ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - int len=0; + guint len=0; tvbuff_t *next_tvb = NULL; fragment_data *fd_head; spx_info *spx_info; @@ -4399,8 +4399,8 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Fragment */ tid = (pinfo->srcport+pinfo->destport); - len = tvb_reported_length_remaining(tvb, 0); - if (tvb_bytes_exist(tvb, 0, len)) + len = tvb_reported_length(tvb); + if (tvb_length(tvb) >= len) { fd_head = fragment_add_seq_next(tvb, 0, pinfo, tid, ndps_fragment_table, ndps_reassembled_table, len, !spx_info->eom); if (fd_head != NULL) diff --git a/epan/dissectors/packet-olsr.c b/epan/dissectors/packet-olsr.c index f7c1635ece..4cebda3c25 100644 --- a/epan/dissectors/packet-olsr.c +++ b/epan/dissectors/packet-olsr.c @@ -111,7 +111,7 @@ dissect_olsr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint16 packet_len; /* Does this packet have a valid message type at the beginning? */ - if (!tvb_bytes_exist(tvb, 0, 2)) + if (tvb_length(tvb) < 2) return 0; /* not enough bytes for the packet length */ packet_len = tvb_get_ntohs(tvb, 0); if (packet_len < 4) diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c index 81079aaeed..12cbca6eba 100644 --- a/epan/dissectors/packet-smb-pipe.c +++ b/epan/dissectors/packet-smb-pipe.c @@ -3281,7 +3281,7 @@ dissect_pipe_dcerpc(tvbuff_t *d_tvb, packet_info *pinfo, proto_tree *parent_tree pinfo->desegment_offset = 0; pinfo->desegment_len = 0; reported_len = tvb_reported_length(d_tvb); - if(smb_dcerpc_reassembly && tvb_bytes_exist(d_tvb, 0, reported_len)){ + if(smb_dcerpc_reassembly && tvb_length(d_tvb) >= reported_len){ pinfo->can_desegment=2; } diff --git a/epan/dissectors/packet-tapa.c b/epan/dissectors/packet-tapa.c index 5ee2e601d0..a9c487f171 100644 --- a/epan/dissectors/packet-tapa.c +++ b/epan/dissectors/packet-tapa.c @@ -427,7 +427,7 @@ test_tapa_discover(tvbuff_t *tvb) guint8 type, unknown, req_type; guint16 length; - if (!tvb_bytes_exist(tvb, 0, 4)) + if (tvb_length(tvb) < 4) return FALSE; /* Type(1 byte) <= 5, unknown(1 byte), length(2 bytes) */ @@ -453,7 +453,7 @@ test_tapa_tunnel(tvbuff_t *tvb) { /* If it isn't IPv4, it's TAPA. IPv4: Version(1 byte) = 4, length(2 bytes) >= 20 */ - if (!tvb_bytes_exist(tvb, 0, 4) || + if (tvb_length(tvb) < 4 || (tvb_get_guint8(tvb, 0) & 0xF0) >= 0x40 || tvb_get_ntohs(tvb, 2) > 0 || tvb_get_guint8(tvb, 1) > 1) { /* Is tunnel type known? */ diff --git a/epan/dissectors/packet-xot.c b/epan/dissectors/packet-xot.c index f75f10818b..3fdef5a976 100644 --- a/epan/dissectors/packet-xot.c +++ b/epan/dissectors/packet-xot.c @@ -118,7 +118,7 @@ static int dissect_xot(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * Do we have the full version number and, if so, is it zero? * If we have it but it's not zero, reject this segment. */ - if (tvb_bytes_exist(tvb, 0, 2)) { + if (tvb_length(tvb) >= 2) { if (tvb_get_ntohs(tvb, 0) != 0) return 0; } |