diff --git a/epan/dissectors/file-elf.c b/epan/dissectors/file-elf.c index 744e85116c..685b0a526f 100644 --- a/epan/dissectors/file-elf.c +++ b/epan/dissectors/file-elf.c @@ -603,7 +603,7 @@ static const range_string dynamic_tag_rvals[] = { typedef struct _segment_info_t { guint64 offset; guint64 size; - const guint8 *name; + const char *name; } segment_info_t; void proto_register_elf(void); @@ -1094,7 +1094,7 @@ dissect_eh_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *segment_tree, tvb, offset, 1, machine_encoding); offset += 1; - augmentation_string = tvb_get_const_stringz(tvb, offset, &size); + augmentation_string = (const gchar*)tvb_get_const_stringz(tvb, offset, &size); proto_tree_add_item(entry_tree, hf_elf_eh_frame_augmentation_string, tvb, offset, size, machine_encoding); offset += size; @@ -1185,7 +1185,7 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) guint16 shstrndx; guint64 shstrtab_offset; guint32 sh_name; - const guint8 *section_name; + const char *section_name; guint64 length; guint64 segment_offset; guint64 segment_size; @@ -1471,7 +1471,7 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) tvb_get_ntoh64(tvb, value_guard(length)) : tvb_get_letoh64(tvb, value_guard(length)); } - section_name = tvb_get_const_stringz(tvb, value_guard(shstrtab_offset + sh_name), NULL); + section_name = (const char *)tvb_get_const_stringz(tvb, value_guard(shstrtab_offset + sh_name), NULL); if (register_size == REGISTER_64_SIZE && machine_encoding == ENC_BIG_ENDIAN) { offset += 4; @@ -1546,7 +1546,7 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) tvb_get_ntoh64(tvb, value_guard(length)) : tvb_get_letoh64(tvb, value_guard(length)); } - section_name = tvb_get_const_stringz(tvb, value_guard(shstrtab_offset + sh_name), NULL); + section_name = (const char*)tvb_get_const_stringz(tvb, value_guard(shstrtab_offset + sh_name), NULL); if (section_name) proto_item_append_text(sh_entry_item, ": %s", section_name); diff --git a/epan/dissectors/file-jpeg.c b/epan/dissectors/file-jpeg.c index 4a2e703a54..56c2e425da 100644 --- a/epan/dissectors/file-jpeg.c +++ b/epan/dissectors/file-jpeg.c @@ -520,7 +520,7 @@ process_app0_segment(proto_tree *tree, tvbuff_t *tvb, guint32 len, proto_tree_add_item(subtree, hf_len, tvb, 2, 2, ENC_BIG_ENDIAN); - str = tvb_get_stringz_enc(wmem_packet_scope(), tvb, 4, &str_size, ENC_ASCII); + str = (char *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, 4, &str_size, ENC_ASCII); ti = proto_tree_add_item(subtree, hf_identifier, tvb, 4, str_size, ENC_ASCII|ENC_NA); if (strcmp(str, "JFIF") == 0) { /* Version */ @@ -599,7 +599,7 @@ process_app1_segment(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, guint3 proto_tree_add_item(subtree, hf_len, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; - str = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &str_size, ENC_ASCII); + str = (char*)tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &str_size, ENC_ASCII); ti = proto_tree_add_item(subtree, hf_identifier, tvb, offset, str_size, ENC_ASCII|ENC_NA); offset += str_size; @@ -723,7 +723,7 @@ process_app2_segment(proto_tree *tree, tvbuff_t *tvb, guint32 len, proto_tree_add_item(subtree, hf_len, tvb, 2, 2, ENC_BIG_ENDIAN); - str = tvb_get_stringz_enc(wmem_packet_scope(), tvb, 4, &str_size, ENC_ASCII); + str = (char*)tvb_get_stringz_enc(wmem_packet_scope(), tvb, 4, &str_size, ENC_ASCII); ti = proto_tree_add_item(subtree, hf_identifier, tvb, 4, str_size, ENC_ASCII|ENC_NA); if (strcmp(str, "FPXR") == 0) { proto_tree_add_item(tree, hf_exif_flashpix_marker, tvb, 0, -1, ENC_NA); @@ -751,10 +751,10 @@ dissect_jfif(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ return 0; /* Check identifier field in first App segment is "JFIF", although "Exif" from App1 can/does appear here too... */ - if (tvb_memeql(tvb, 6, "Exif", 5) == 0) { + if (tvb_memeql(tvb, 6, (const guint8*)"Exif", 5) == 0) { show_first_identifier_not_jfif = TRUE; } - else if (tvb_memeql(tvb, 6, "JFIF", 5)) { + else if (tvb_memeql(tvb, 6, (const guint8*)"JFIF", 5)) { return 0; } diff --git a/epan/dissectors/file-pcapng.c b/epan/dissectors/file-pcapng.c index 875cf46489..7fcfb1bb18 100644 --- a/epan/dissectors/file-pcapng.c +++ b/epan/dissectors/file-pcapng.c @@ -1156,7 +1156,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, proto_tree_add_item(option_tree, hf_pcapng_option_data_packet_drop_count, tvb, offset, 8, encoding); value.u64 = tvb_get_guint64(tvb, offset, encoding); - str = wmem_strdup_printf(wmem_packet_scope(), "%"G_GUINT64_FORMAT, value.u64); + str = (const guint8*)wmem_strdup_printf(wmem_packet_scope(), "%"G_GUINT64_FORMAT, value.u64); offset += 8; break; @@ -1165,7 +1165,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, value.u32 = tvb_get_guint32(tvb, offset, encoding); offset += option_length; - str = wmem_strdup_printf(wmem_packet_scope(), "%u", value.u32); + str = (const guint8*)wmem_strdup_printf(wmem_packet_scope(), "%u", value.u32); break; case 32770: /* Darwin Service Type */ @@ -1173,7 +1173,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, value.u32 = tvb_get_guint32(tvb, offset, encoding); offset += option_length; - str = wmem_strdup_printf(wmem_packet_scope(), "%s", val_to_str_const(value.u32, option_code_darwin_svc_class_vals, "Unknown")); + str = (const guint8*)wmem_strdup_printf(wmem_packet_scope(), "%s", val_to_str_const(value.u32, option_code_darwin_svc_class_vals, "Unknown")); break; case 32771: /* Darwin Effective DPEB ID */ @@ -1181,7 +1181,7 @@ static gint dissect_options(proto_tree *tree, packet_info *pinfo, value.u32 = tvb_get_guint32(tvb, offset, encoding); offset += option_length; - str = wmem_strdup_printf(wmem_packet_scope(), "%u", value.u32); + str = (const guint8*)wmem_strdup_printf(wmem_packet_scope(), "%u", value.u32); break; default: