Skip to content

Commit

Permalink
Try to fix clang tvb_memeql-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersBroman committed Sep 7, 2022
1 parent 83a0ec0 commit 625b422
Show file tree
Hide file tree
Showing 26 changed files with 69 additions and 69 deletions.
4 changes: 2 additions & 2 deletions epan/dissectors/asn1/ldap/ldap.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions epan/dissectors/packet-amqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
*/
Expand Down Expand Up @@ -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);
}
Expand All @@ -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; */
Expand All @@ -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;

/*
Expand Down Expand Up @@ -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);
Expand All @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-asphodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions epan/dissectors/packet-bittorrent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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",
Expand All @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions epan/dissectors/packet-bt-dht.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-dvb-eit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-fcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions epan/dissectors/packet-finger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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>.
*/
Expand Down
4 changes: 2 additions & 2 deletions epan/dissectors/packet-gearman.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions epan/dissectors/packet-gssapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,15 @@ 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);
encrypt_info->gssapi_data_encrypted = TRUE;
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),
Expand All @@ -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);
Expand Down
22 changes: 11 additions & 11 deletions epan/dissectors/packet-hdfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions epan/dissectors/packet-jxta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions epan/dissectors/packet-ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-ncp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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', ' ', ' ', ' '
};

Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-ntlmssp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion epan/dissectors/packet-ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 625b422

Please sign in to comment.