diff options
author | Anders Broman <anders.broman@ericsson.com> | 2022-09-07 14:07:47 +0200 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2022-09-07 14:07:47 +0200 |
commit | 625b422edfabb3a0c5d4a1ecd6b56b2698192605 (patch) | |
tree | b595c69cfb6b2f58bbd9b713171dc1e3716f1ae1 /epan | |
parent | 83a0ec0647b171e50a254b5c73b32d3f7a788fb5 (diff) |
Try to fix clang tvb_memeql-warnings
Diffstat (limited to 'epan')
26 files changed, 69 insertions, 69 deletions
diff --git a/epan/dissectors/asn1/ldap/ldap.cnf b/epan/dissectors/asn1/ldap/ldap.cnf index bd6ea73e35..070132ea36 100644 --- a/epan/dissectors/asn1/ldap/ldap.cnf +++ b/epan/dissectors/asn1/ldap/ldap.cnf @@ -276,7 +276,7 @@ ldap_conv_info_t *ldap_info; * NTLMSSP blob */ if ( (tvb_reported_length(parameter_tvb)>=7) - && (!tvb_memeql(parameter_tvb, 0, "NTLMSSP", 7))){ + && (!tvb_memeql(parameter_tvb, 0, (const guint8*)"NTLMSSP", 7))){ call_dissector(ntlmssp_handle, parameter_tvb, actx->pinfo, tree); break; } @@ -700,7 +700,7 @@ ldap_conv_info_t *ldap_info; if( new_tvb && (tvb_reported_length(new_tvb)>=7) - && (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){ + && (!tvb_memeql(new_tvb, 0, (const guint8*)"NTLMSSP", 7))){ /* make sure the protocol op comes first */ ldap_do_protocolop(actx->pinfo); diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c index f31909e0a6..d141acabb3 100644 --- a/epan/dissectors/packet-amqp.c +++ b/epan/dissectors/packet-amqp.c @@ -2191,7 +2191,7 @@ check_amqp_version(tvbuff_t *tvb, amqp_conv *conn) if ((conn->version != 0) && (tvb_get_guint8(tvb, 0) != 'A')) return; - if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { + if (tvb_memeql(tvb, 0, (const guint8*)"AMQP", 4) == 0) { /* AMQP 0-* has protocol major/minor in 6th/7th byte, while AMQP 1.0 * has it in 5th/6th byte (7th is revision) */ @@ -2250,7 +2250,7 @@ get_amqp_1_0_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* Heuristic - protocol initialisation frame starts with 'AMQP' */ - if (tvb_memeql(tvb, offset, "AMQP", 4) == 0) + if (tvb_memeql(tvb, offset, (const guint8*)"AMQP", 4) == 0) return 8; return (guint) tvb_get_ntohl(tvb, offset); } @@ -2260,7 +2260,7 @@ get_amqp_0_10_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) { /* Heuristic - protocol initialisation frame starts with 'AMQP' */ - if (tvb_memeql(tvb, offset, "AMQP", 4) == 0) + if (tvb_memeql(tvb, offset, (const guint8*)"AMQP", 4) == 0) return 8; return (guint) tvb_get_ntohs(tvb, offset + 2); /* Max *frame* length = 65K; */ @@ -2273,7 +2273,7 @@ get_amqp_0_9_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, guint32 length; /* Heuristic - protocol initialisation frame starts with 'AMQP' */ - if (tvb_memeql(tvb, offset, "AMQP", 4) == 0) + if (tvb_memeql(tvb, offset, (const guint8*)"AMQP", 4) == 0) return 8; /* @@ -6513,7 +6513,7 @@ dissect_amqp_1_0_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void dissect_amqp_1_0_SASL_frame(next_tvb, amqp_tree, pinfo); break; case AMQP_1_0_TLS_FRAME: - /* should not occur, this is handled in '(tvb_memeql(tvb, 0, "AMQP", 4) == 0)' test above */ + /* should not occur, this is handled in '(tvb_memeql(tvb, 0, (const guint8*)"AMQP", 4) == 0)' test above */ break; default: expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %d", frame_type); @@ -6534,7 +6534,7 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi tvbuff_t *next_tvb; /* Heuristic - protocol initialisation frame starts with 'AMQP' */ - if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { + if (tvb_memeql(tvb, 0, (const guint8*)"AMQP", 4) == 0) { guint8 proto_major; guint8 proto_minor; @@ -9058,7 +9058,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void guint16 channel_num, class_id, method_id; /* Heuristic - protocol initialisation frame starts with 'AMQP' */ - if (tvb_memeql(tvb, 0, "AMQP", 4) == 0) { + if (tvb_memeql(tvb, 0, (const guint8*)"AMQP", 4) == 0) { guint8 proto_id, proto_major, proto_minor; proto_id = tvb_get_guint8(tvb, 5); diff --git a/epan/dissectors/packet-asphodel.c b/epan/dissectors/packet-asphodel.c index 51bb1d09bc..c208b2ef0b 100644 --- a/epan/dissectors/packet-asphodel.c +++ b/epan/dissectors/packet-asphodel.c @@ -556,7 +556,7 @@ dissect_asphodel_heur_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v return FALSE; } - if (tvb_memeql(tvb, 2, "Asphodel", 9) != 0) + if (tvb_memeql(tvb, 2, (const guint8*)"Asphodel", 9) != 0) { return FALSE; } diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c index 3e17997d93..2ae5701740 100644 --- a/epan/dissectors/packet-bittorrent.c +++ b/epan/dissectors/packet-bittorrent.c @@ -383,7 +383,7 @@ get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, guint32 length; if (tvb_get_guint8(tvb, offset) == 19 && - tvb_memeql(tvb, offset + 1, "BitTorrent protocol", 19) == 0) { + tvb_memeql(tvb, offset + 1, (const guint8*)"BitTorrent protocol", 19) == 0) { /* Return the length of a Handshake message */ return 1 + /* pstrlen */ 19 + /* pstr */ @@ -649,7 +649,7 @@ dissect_bittorrent_welcome (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if(decode_client_information) { for(i = 0; peer_id[i].name != NULL; ++i) { - if(tvb_memeql(tvb, offset, peer_id[i].id, (int)strlen(peer_id[i].id)) == 0) { + if(tvb_memeql(tvb, offset, (const guint8*)peer_id[i].id, (int)strlen(peer_id[i].id)) == 0) { version = tvb_get_string_enc(pinfo->pool, tvb, offset + (int)strlen(peer_id[i].id), peer_id[i].ver_len, ENC_ASCII); proto_tree_add_string_format(tree, hf_bittorrent_version, tvb, offset, 20, version, "Client is %s v%s", @@ -675,7 +675,7 @@ int dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *t tree = proto_item_add_subtree(ti, ett_bittorrent); if (tvb_get_guint8(tvb, 0) == 19 && - tvb_memeql(tvb, 1, "BitTorrent protocol", 19) == 0) { + tvb_memeql(tvb, 1, (const guint8*)"BitTorrent protocol", 19) == 0) { dissect_bittorrent_welcome(tvb, pinfo, tree); } else { dissect_bittorrent_message(tvb, pinfo, tree); @@ -711,7 +711,7 @@ gboolean test_bittorrent_packet (tvbuff_t *tvb, packet_info *pinfo, if (tvb_captured_length(tvb) >= 20 && tvb_get_guint8(tvb, 0) == 19 && - tvb_memeql(tvb, 1, "BitTorrent protocol", 19) == 0) { + tvb_memeql(tvb, 1, (const guint8*)"BitTorrent protocol", 19) == 0) { conversation = find_or_create_conversation(pinfo); conversation_set_dissector(conversation, dissector_handle); diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c index e63b040199..90102ff0b5 100644 --- a/epan/dissectors/packet-bt-dht.c +++ b/epan/dissectors/packet-bt-dht.c @@ -567,13 +567,13 @@ test_bt_dht(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) if (tvb_captured_length_remaining(tvb, offset) < DHT_MIN_LEN) return FALSE; - if (tvb_memeql(tvb, offset, "d1:ad", 5) == 0) { + if (tvb_memeql(tvb, offset, (const guint8*)"d1:ad", 5) == 0) { return TRUE; - } else if (tvb_memeql(tvb, offset, "d1:rd", 5) == 0) { + } else if (tvb_memeql(tvb, offset, (const guint8*)"d1:rd", 5) == 0) { return TRUE; - } else if (tvb_memeql(tvb, offset, "d2:ip", 5) == 0) { + } else if (tvb_memeql(tvb, offset, (const guint8*)"d2:ip", 5) == 0) { return TRUE; - } else if (tvb_memeql(tvb, offset, "d1:el", 5) == 0) { + } else if (tvb_memeql(tvb, offset, (const guint8*)"d1:el", 5) == 0) { return TRUE; } diff --git a/epan/dissectors/packet-dvb-eit.c b/epan/dissectors/packet-dvb-eit.c index 244dd68a7b..ae53e9cd53 100644 --- a/epan/dissectors/packet-dvb-eit.c +++ b/epan/dissectors/packet-dvb-eit.c @@ -139,7 +139,7 @@ dissect_dvb_eit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data proto_tree_add_item(dvb_eit_event_tree, hf_dvb_eit_event_id, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - if (tvb_memeql(tvb, offset, "\xFF\xFF\xFF\xFF\xFF", 5)) { + if (tvb_memeql(tvb, offset, (const guint8*)"\xFF\xFF\xFF\xFF\xFF", 5)) { if (packet_mpeg_sect_mjd_to_utc_time(tvb, offset, &start_time) < 0) { proto_tree_add_time_format(dvb_eit_event_tree, hf_dvb_eit_start_time, tvb, offset, 5, &start_time, "Unparseable time"); diff --git a/epan/dissectors/packet-fcoe.c b/epan/dissectors/packet-fcoe.c index 52721697e7..0b4c9cac07 100644 --- a/epan/dissectors/packet-fcoe.c +++ b/epan/dissectors/packet-fcoe.c @@ -109,7 +109,7 @@ fcoe_get_eof(tvbuff_t *tvb, gint eof_offset) } padding_remaining = MIN(tvb_captured_length_remaining(tvb, eof_offset+1),3); - if (tvb_memeql(tvb, eof_offset+1, "\x00\x00\x00", padding_remaining)) { + if (tvb_memeql(tvb, eof_offset+1, (const guint8*)"\x00\x00\x00", padding_remaining)) { return NULL; } diff --git a/epan/dissectors/packet-finger.c b/epan/dissectors/packet-finger.c index 6c894a0e07..e4ae32ca4c 100644 --- a/epan/dissectors/packet-finger.c +++ b/epan/dissectors/packet-finger.c @@ -71,7 +71,7 @@ dissect_finger(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (!PINFO_FD_VISITED(pinfo)) { if (pinfo->can_desegment) { if (is_query) { - if ((len < 2) || (tvb_memeql(tvb, len - 2, "\r\n", 2))) { + if ((len < 2) || (tvb_memeql(tvb, len - 2, (const guint8*)"\r\n", 2))) { pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; pinfo->desegment_offset = 0; return -1; @@ -112,7 +112,7 @@ dissect_finger(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (is_query) { expert_ti = proto_tree_add_item(finger_tree, hf_finger_query, tvb, 0, -1, ENC_ASCII); - if ((len < 2) || (tvb_memeql(tvb, len - 2, "\r\n", 2))) { + if ((len < 2) || (tvb_memeql(tvb, len - 2, (const guint8*)"\r\n", 2))) { /* * From RFC742, Send a single "command line", ending with <CRLF>. */ diff --git a/epan/dissectors/packet-gearman.c b/epan/dissectors/packet-gearman.c index 6c8b8715ce..5975468e61 100644 --- a/epan/dissectors/packet-gearman.c +++ b/epan/dissectors/packet-gearman.c @@ -68,8 +68,8 @@ static gboolean gearman_desegment = TRUE; static const int GEARMAN_COMMAND_HEADER_SIZE = 12; static const int GEARMAN_PORT = 4730; -static const gchar *GEARMAN_MAGIC_CODE_REQUEST = "\0REQ"; -static const gchar *GEARMAN_MAGIC_CODE_RESPONSE = "\0RES"; +static const guchar *GEARMAN_MAGIC_CODE_REQUEST = "\0REQ"; +static const guchar *GEARMAN_MAGIC_CODE_RESPONSE = "\0RES"; static const gchar *GEARMAN_MGR_CMDS[] = { "workers", diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c index 6622783132..0b2dafd043 100644 --- a/epan/dissectors/packet-gssapi.c +++ b/epan/dissectors/packet-gssapi.c @@ -299,7 +299,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* Maybe it's new NTLMSSP payload */ if ((tvb_captured_length_remaining(gss_tvb, start_offset)>16) && - ((tvb_memeql(gss_tvb, start_offset, "\x01\x00\x00\x00", 4) == 0))) { + ((tvb_memeql(gss_tvb, start_offset, (const guint8*)"\x01\x00\x00\x00", 4) == 0))) { return_offset = call_dissector(ntlmssp_payload_handle, tvb_new_subset_remaining(gss_tvb, start_offset), pinfo, subtree); @@ -307,7 +307,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, goto done; } if ((tvb_captured_length_remaining(gss_tvb, start_offset)==16) && - ((tvb_memeql(gss_tvb, start_offset, "\x01\x00\x00\x00", 4) == 0))) { + ((tvb_memeql(gss_tvb, start_offset, (const guint8*)"\x01\x00\x00\x00", 4) == 0))) { if( is_verifier ) { return_offset = call_dissector(ntlmssp_verf_handle, tvb_new_subset_remaining(gss_tvb, start_offset), @@ -324,8 +324,8 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* Maybe it's new GSSKRB5 CFX Wrapping */ if ((tvb_captured_length_remaining(gss_tvb, start_offset)>2) && - ((tvb_memeql(gss_tvb, start_offset, "\04\x04", 2) == 0) || - (tvb_memeql(gss_tvb, start_offset, "\05\x04", 2) == 0))) { + ((tvb_memeql(gss_tvb, start_offset, (const guint8*)"\04\x04", 2) == 0) || + (tvb_memeql(gss_tvb, start_offset, (const guint8*)"\05\x04", 2) == 0))) { return_offset = call_dissector_with_data(spnego_krb5_wrap_handle, tvb_new_subset_remaining(gss_tvb, start_offset), pinfo, subtree, encrypt_info); diff --git a/epan/dissectors/packet-hdfs.c b/epan/dissectors/packet-hdfs.c index 07e9fd3562..70ab71f966 100644 --- a/epan/dissectors/packet-hdfs.c +++ b/epan/dissectors/packet-hdfs.c @@ -132,14 +132,14 @@ dissect_params (tvbuff_t *tvb, proto_tree *hdfs_tree, guint offset, int params) proto_tree_add_item(hdfs_tree, hf_hdfs_paramtype, tvb, offset, length, ENC_ASCII); offset += length; - if (offset >= length && (!tvb_memeql(tvb, offset - length, "long", length) || !tvb_memeql(tvb, offset - length, "int", length) || - !tvb_memeql(tvb, offset - length, "short", length) || !tvb_memeql(tvb, offset - length, "char", length) || - !tvb_memeql(tvb, offset - length, "byte", length) || !tvb_memeql(tvb, offset - length, "float", length) - || !tvb_memeql(tvb, offset - length, "double", length) || !tvb_memeql(tvb, offset - length, "boolean", length))) { + if (offset >= length && (!tvb_memeql(tvb, offset - length, (const guint8*)"long", length) || !tvb_memeql(tvb, offset - length, (const guint8*)"int", length) || + !tvb_memeql(tvb, offset - length, (const guint8*)"short", length) || !tvb_memeql(tvb, offset - length, (const guint8*)"char", length) || + !tvb_memeql(tvb, offset - length, (const guint8*)"byte", length) || !tvb_memeql(tvb, offset - length, (const guint8*)"float", length) + || !tvb_memeql(tvb, offset - length, (const guint8*)"double", length) || !tvb_memeql(tvb, offset - length, (const guint8*)"boolean", length))) { - if (!tvb_memeql(tvb, offset - length, "boolean", length)) { + if (!tvb_memeql(tvb, offset - length, (const guint8*)"boolean", length)) { length = 1; - } else if (!tvb_memeql(tvb, offset - length, "short", length)) { + } else if (!tvb_memeql(tvb, offset - length, (const guint8*)"short", length)) { length = 2; } else { length = sizeof(type_name); @@ -159,7 +159,7 @@ dissect_params (tvbuff_t *tvb, proto_tree *hdfs_tree, guint offset, int params) proto_tree_add_item(hdfs_tree, hf_hdfs_paramval, tvb, offset, length, ENC_ASCII); offset += length; - if (!tvb_memeql(tvb, offset - length, "org.apache.hadoop.fs.permission.FsPermission", length)) { + if (!tvb_memeql(tvb, offset - length, (const guint8*)"org.apache.hadoop.fs.permission.FsPermission", length)) { proto_tree_add_item(hdfs_tree, hf_hdfs_fileperm, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } @@ -544,7 +544,7 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* return offset; } - if (!tvb_memeql(tvb, offset + 2, "long", 4)) { + if (!tvb_memeql(tvb, offset + 2, (const guint8*)"long", 4)) { dissect_resp_long (tvb, hdfs_tree, offset); } else { @@ -570,11 +570,11 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* offset += length; /* responses about block location info */ - if (!tvb_memeql(tvb, offset - length, "org.apache.hadoop.hdfs.protocol.LocatedBlocks", length)) { + if (!tvb_memeql(tvb, offset - length, (const guint8*)"org.apache.hadoop.hdfs.protocol.LocatedBlocks", length)) { dissect_resp_locatedblocks (tvb, hdfs_tree, offset); /* responses about file statuses */ - } else if (!tvb_memeql(tvb, offset - length, "org.apache.hadoop.hdfs.protocol.HdfsFileStatus", length)) { + } else if (!tvb_memeql(tvb, offset - length, (const guint8*)"org.apache.hadoop.hdfs.protocol.HdfsFileStatus", length)) { dissect_resp_filestatus (tvb, hdfs_tree, offset); } else { @@ -598,7 +598,7 @@ dissect_hdfs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* guint auth = tvb_get_ntohl(tvb, offset); /* first setup packet starts with "hrpc" */ - if (!tvb_memeql(tvb, offset, REQUEST_STR, sizeof(REQUEST_STR) - 1)) { + if (!tvb_memeql(tvb, offset, (const guint8*)REQUEST_STR, sizeof(REQUEST_STR) - 1)) { proto_tree_add_item(hdfs_tree, hf_hdfs_sequenceno, tvb, offset, sizeof(REQUEST_STR) - 1, ENC_ASCII); offset += (int)sizeof(REQUEST_STR) - 1; diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c index d57d2780a3..1d13838b98 100644 --- a/epan/dissectors/packet-jxta.c +++ b/epan/dissectors/packet-jxta.c @@ -465,7 +465,7 @@ static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr break; } - if (tvb_memeql(tvb, offset, JXTA_UDP_SIG, sizeof(JXTA_UDP_SIG)) != 0) { + if (tvb_memeql(tvb, offset, (const guint8*)JXTA_UDP_SIG, sizeof(JXTA_UDP_SIG)) != 0) { /* not ours */ return 0; } @@ -571,7 +571,7 @@ static int dissect_jxta_stream(tvbuff_t * tvb, packet_info * pinfo, proto_tree * goto Common_Exit; } - if (0 == tvb_memeql(tvb, 0, JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) { + if (0 == tvb_memeql(tvb, 0, (const guint8*)JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) { /* The beginning of a JXTA stream connection */ address *welcome_addr; gboolean initiator = FALSE; @@ -802,7 +802,7 @@ static int dissect_jxta_welcome(tvbuff_t * tvb, packet_info * pinfo, proto_tree return (gint) (available - sizeof(JXTA_WELCOME_MSG_SIG)); } - if (0 != tvb_memeql(tvb, 0, JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) { + if (0 != tvb_memeql(tvb, 0, (const guint8*)JXTA_WELCOME_MSG_SIG, sizeof(JXTA_WELCOME_MSG_SIG))) { /* not ours! */ return 0; } @@ -1176,7 +1176,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree break; } - if (tvb_memeql(tvb, offset, JXTA_MSG_SIG, sizeof(JXTA_MSG_SIG)) != 0) { + if (tvb_memeql(tvb, offset, (const guint8*)JXTA_MSG_SIG, sizeof(JXTA_MSG_SIG)) != 0) { /* It is not one of ours */ return 0; } @@ -1478,7 +1478,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p needed = (gint) (sizeof(JXTA_MSGELEM_SIG) - available); } - if (tvb_memeql(tvb, offset, JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) { + if (tvb_memeql(tvb, offset, (const guint8*)JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) { /* It is not one of ours */ return 0; } @@ -1726,7 +1726,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p needed = (gint) (sizeof(JXTA_MSGELEM_SIG) - available); } - if (tvb_memeql(tvb, offset, JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) { + if (tvb_memeql(tvb, offset, (const guint8*)JXTA_MSGELEM_SIG, sizeof(JXTA_MSGELEM_SIG)) != 0) { /* It is not one of ours */ return 0; } diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index d9ad4b112b..88bb3f09ba 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -1586,7 +1586,7 @@ dissect_ldap_T_bindResponse_matchedDN(gboolean implicit_tag _U_, tvbuff_t *tvb _ if( new_tvb && (tvb_reported_length(new_tvb)>=7) - && (!tvb_memeql(new_tvb, 0, "NTLMSSP", 7))){ + && (!tvb_memeql(new_tvb, 0, (const guint8*)"NTLMSSP", 7))){ /* make sure the protocol op comes first */ ldap_do_protocolop(actx->pinfo); @@ -1690,7 +1690,7 @@ ldap_conv_info_t *ldap_info; * NTLMSSP blob */ if ( (tvb_reported_length(parameter_tvb)>=7) - && (!tvb_memeql(parameter_tvb, 0, "NTLMSSP", 7))){ + && (!tvb_memeql(parameter_tvb, 0, (const guint8*)"NTLMSSP", 7))){ call_dissector(ntlmssp_handle, parameter_tvb, actx->pinfo, tree); break; } diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c index 29be6962ca..0b58986c4e 100644 --- a/epan/dissectors/packet-ncp.c +++ b/epan/dissectors/packet-ncp.c @@ -806,7 +806,7 @@ ncp_endpoint_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons #define SYS 0x80 /* System packet */ #define LIP_ECHO_MAGIC_LEN 16 -static char lip_echo_magic[LIP_ECHO_MAGIC_LEN] = { +static const unsigned char lip_echo_magic[LIP_ECHO_MAGIC_LEN] = { 'L', 'I', 'P', ' ', 'E', 'c', 'h', 'o', ' ', 'D', 'a', 't', 'a', ' ', ' ', ' ' }; diff --git a/epan/dissectors/packet-ntlmssp.c b/epan/dissectors/packet-ntlmssp.c index 4d9db64302..9c66ccb402 100644 --- a/epan/dissectors/packet-ntlmssp.c +++ b/epan/dissectors/packet-ntlmssp.c @@ -1192,7 +1192,7 @@ dissect_ntlmssp_blob (tvbuff_t *tvb, packet_info *pinfo, * XXX - should we have a field for Response as well as * ClientChallenge? */ - if (tvb_memeql(tvb, blob_offset+8, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", NTLMSSP_KEY_LEN) == 0) { + if (tvb_memeql(tvb, blob_offset+8, (const guint8*)"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", NTLMSSP_KEY_LEN) == 0) { /* * LMv2_RESPONSE. * diff --git a/epan/dissectors/packet-ntp.c b/epan/dissectors/packet-ntp.c index ce3016d53a..64772e4c8f 100644 --- a/epan/dissectors/packet-ntp.c +++ b/epan/dissectors/packet-ntp.c @@ -1257,7 +1257,7 @@ dissect_ntp_std(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ntp_tree, ntp_con snprintf (buff, NTP_TS_SIZE, "Unidentified reference source '%s'", tvb_get_string_enc(wmem_packet_scope(), tvb, 12, 4, ENC_ASCII)); for (i = 0; primary_sources[i].id; i++) { - if (tvb_memeql(tvb, 12, primary_sources[i].id, 4) == 0) { + if (tvb_memeql(tvb, 12, (const guint8*)primary_sources[i].id, 4) == 0) { snprintf(buff, NTP_TS_SIZE, "%s", primary_sources[i].data); break; diff --git a/epan/dissectors/packet-proxy.c b/epan/dissectors/packet-proxy.c index d66ee050ec..538ff64669 100644 --- a/epan/dissectors/packet-proxy.c +++ b/epan/dissectors/packet-proxy.c @@ -205,7 +205,7 @@ is_proxy_v1(tvbuff_t *tvb, gint *header_length) return FALSE; } - if (tvb_memeql(tvb, 0, "PROXY ", 6) != 0) { + if (tvb_memeql(tvb, 0, (const guint8*)"PROXY ", 6) != 0) { return FALSE; } @@ -215,7 +215,7 @@ is_proxy_v1(tvbuff_t *tvb, gint *header_length) } /* The line must end with a CRLF and not just a single CR or LF. */ - if (tvb_memeql(tvb, next_offset - 2, "\r\n", 2) != 0) { + if (tvb_memeql(tvb, next_offset - 2, (const guint8*)"\r\n", 2) != 0) { return FALSE; } @@ -494,7 +494,7 @@ dissect_proxy_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da { if (tvb_reported_length(tvb) >= 16 && tvb_captured_length(tvb) >= sizeof(proxy_v2_magic) && - tvb_memeql(tvb, 0, proxy_v2_magic, sizeof(proxy_v2_magic)) == 0) { + tvb_memeql(tvb, 0, (const guint8*)proxy_v2_magic, sizeof(proxy_v2_magic)) == 0) { // TODO maybe check for "(hdr.v2.ver_cmd & 0xF0) == 0x20" as done in "9. Sample code" from // https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt? dissect_proxy_v2(tvb, pinfo, tree, data); diff --git a/epan/dissectors/packet-raw.c b/epan/dissectors/packet-raw.c index 85207e4e41..7b46a8f101 100644 --- a/epan/dissectors/packet-raw.c +++ b/epan/dissectors/packet-raw.c @@ -24,7 +24,7 @@ void proto_reg_handoff_raw(void); static int proto_raw = -1; static gint ett_raw = -1; -static const char zeroes[10] = {0,0,0,0,0,0,0,0,0,0}; +static const unsigned char zeroes[10] = {0,0,0,0,0,0,0,0,0,0}; static dissector_handle_t raw_handle; static dissector_handle_t ip_handle; diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c index aaea2b0a3d..e8f818e94e 100644 --- a/epan/dissectors/packet-rdp.c +++ b/epan/dissectors/packet-rdp.c @@ -2850,7 +2850,7 @@ dissect_rdp_cr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* /* * routingToken or cookie? Both begin with "Cookie: ". */ - if (tvb_memeql(tvb, offset, "Cookie: ", 8) == 0) { + if (tvb_memeql(tvb, offset, (const guint8*)"Cookie: ", 8) == 0) { /* Looks like a routing token or cookie */ have_cookie = TRUE; } else if (tvb_bytes_exist(tvb, offset, 4) && diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 5d6c93caf0..e40c719414 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -1220,7 +1220,7 @@ dissect_rtp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data version = RTP_VERSION( octet1 ); if (version == 0) { - if (!(tvb_memeql(tvb, 4, "ZRTP", 4))) + if (!(tvb_memeql(tvb, 4, (const guint8*)"ZRTP", 4))) { call_dissector_only(zrtp_handle, tvb, pinfo, tree, NULL); return TRUE; @@ -1971,7 +1971,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ return tvb_captured_length(tvb); case RTP0_INVALID: - if (!(tvb_memeql(tvb, 4, "ZRTP", 4))) + if (!(tvb_memeql(tvb, 4, (const guint8*)"ZRTP", 4))) { call_dissector(zrtp_handle, tvb,pinfo, tree); return tvb_captured_length(tvb); diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c index e914d0c0e8..9c32b539e2 100644 --- a/epan/dissectors/packet-selfm.c +++ b/epan/dissectors/packet-selfm.c @@ -2075,7 +2075,7 @@ dissect_fastmsg_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o Save this word for use in the element index printing but don't print the word itself until the end of the tree dissection */ for (cnt = offset; cnt < len; cnt++) { - if (tvb_memeql(tvb, cnt, "\xFF\xFF\xFF\xFE", 4) == 0) { + if (tvb_memeql(tvb, cnt, (const guint8*)"\xFF\xFF\xFF\xFE", 4) == 0) { elmt_status32_ofs = cnt+4; } } @@ -2311,7 +2311,7 @@ dissect_fastmsg_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o /* 'reserved' space for the control regions. Detect these and skip if they are present */ if (tvb_reported_length_remaining(tvb, offset) > 2) { - if (tvb_memeql(tvb, offset, "\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) { + if (tvb_memeql(tvb, offset, (const guint8*)"\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) { offset += 8; } } @@ -2356,7 +2356,7 @@ dissect_fastmsg_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o /* find the null separators and add the bit label text strings to the tree */ for (null_offset = offset; null_offset < len; null_offset++) { - if ((tvb_memeql(tvb, null_offset, "\x00", 1) == 0) && (tvb_reported_length_remaining(tvb, offset) > 2)) { + if ((tvb_memeql(tvb, null_offset, (const guint8*)"\x00", 1) == 0) && (tvb_reported_length_remaining(tvb, offset) > 2)) { gchar* str = tvb_format_text(pinfo->pool, tvb, offset, (null_offset-offset)); proto_tree_add_string_format(fastmsg_tree, hf_selfm_fastmsg_bit_label_name, tvb, offset, (null_offset-offset), str, "Bit Label #%d Name: %s", cnt, str); diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index 6d6daa9a4d..a12545e7de 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -3539,7 +3539,7 @@ static void dissect_smb2_secblob(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, smb2_info_t *si _U_) { if ((tvb_captured_length(tvb)>=7) - && (!tvb_memeql(tvb, 0, "NTLMSSP", 7))) { + && (!tvb_memeql(tvb, 0, (const guint8*)"NTLMSSP", 7))) { call_dissector(ntlmssp_handle, tvb, pinfo, tree); } else { call_dissector(gssapi_handle, tvb, pinfo, tree); diff --git a/epan/dissectors/packet-usbms-bot.c b/epan/dissectors/packet-usbms-bot.c index cccc543af7..d526906224 100644 --- a/epan/dissectors/packet-usbms-bot.c +++ b/epan/dissectors/packet-usbms-bot.c @@ -357,8 +357,8 @@ dissect_usbms_bot_bulk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tre static gboolean dissect_usbms_bot_bulk_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) { - const gchar usbc[] = {0x55, 0x53, 0x42, 0x43}; - const gchar usbs[] = {0x55, 0x53, 0x42, 0x53}; + const guchar usbc[] = {0x55, 0x53, 0x42, 0x43}; + const guchar usbs[] = {0x55, 0x53, 0x42, 0x53}; if (tvb_reported_length(tvb) < 4) return FALSE; diff --git a/epan/dissectors/packet-whois.c b/epan/dissectors/packet-whois.c index 88ad6494cc..78bd02faff 100644 --- a/epan/dissectors/packet-whois.c +++ b/epan/dissectors/packet-whois.c @@ -86,7 +86,7 @@ dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, if (!PINFO_FD_VISITED(pinfo)) { if (pinfo->can_desegment) { if (is_query) { - if ((len < 2) || (tvb_memeql(tvb, len - 2, "\r\n", 2))) { + if ((len < 2) || (tvb_memeql(tvb, len - 2, (const guint8*)"\r\n", 2))) { pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; pinfo->desegment_offset = 0; return -1; @@ -136,7 +136,7 @@ dissect_whois(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, */ if (is_query) { expert_ti = proto_tree_add_item(whois_tree, hf_whois_query, tvb, 0, -1, ENC_ASCII); - if ((len < 2) || (tvb_memeql(tvb, len - 2, "\r\n", 2))) { + if ((len < 2) || (tvb_memeql(tvb, len - 2, (const guint8*)"\r\n", 2))) { /* * From RFC3912, section 2: * All requests are terminated with ASCII CR and then ASCII LF. diff --git a/epan/dissectors/packet-yhoo.c b/epan/dissectors/packet-yhoo.c index c080cddde0..a251d111f3 100644 --- a/epan/dissectors/packet-yhoo.c +++ b/epan/dissectors/packet-yhoo.c @@ -179,8 +179,8 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ return FALSE; } - if (tvb_memeql(tvb, offset, "YPNS", 4) != 0 && - tvb_memeql(tvb, offset, "YHOO", 4) != 0) { + if (tvb_memeql(tvb, offset, (const guint8*)"YPNS", 4) != 0 && + tvb_memeql(tvb, offset, (const guint8*)"YHOO", 4) != 0) { /* Not a Yahoo Messenger packet. */ return FALSE; } @@ -188,7 +188,7 @@ dissect_yhoo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ col_set_str(pinfo->cinfo, COL_PROTOCOL, "YHOO"); col_add_fstr(pinfo->cinfo, COL_INFO, "%s: %s", - ( tvb_memeql(tvb, offset + 0, "YPNS", 4) == 0 ) ? "Request" : "Response", + ( tvb_memeql(tvb, offset + 0, (const guint8*)"YPNS", 4) == 0 ) ? "Request" : "Response", val_to_str(tvb_get_letohl(tvb, offset + 12), yhoo_service_vals, "Unknown Service: %u")); diff --git a/epan/dissectors/packet-ymsg.c b/epan/dissectors/packet-ymsg.c index 2440f6c12c..9a762a877d 100644 --- a/epan/dissectors/packet-ymsg.c +++ b/epan/dissectors/packet-ymsg.c @@ -466,7 +466,7 @@ dissect_ymsg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) if (tvb_captured_length(tvb) < 4) { return FALSE; } - if (tvb_memeql(tvb, 0, "YMSG", 4) == -1) { + if (tvb_memeql(tvb, 0, (const guint8*)"YMSG", 4) == -1) { /* Not a Yahoo Messenger packet. */ return FALSE; } |