wireshark/epan
João Valverde 6d06d4e46b Add some UTF-8 debug checks with a compile time flag
Some older dissectors that predate Unicode and parse text protocols
are prone to generate invalid UTF-8 strings. This is a bug and can have
safety implications.

For example passing invalid UTF-8 to proto_tree_add_string() is a
common bug. There are safeguards in format_text() but this should
not be relied on as a general solution to the problem.

For one, as the name implies, it is only used with representation of a
field value, which is not the same as the value itself of an FT_STRING field.
Issue #18317 shows another reason why.

For now this compile flag only enables extra checks for string ftypes,
which covers a subset of proto.h APIs including
proto_tree_append_string(). Later is should be extended to other
interfaces.

This is also not expected to be disabled for release builds because
there are still many dissectors that do not correctly handle strings.
More work is needed to 1) identify them and 2) fix them.

Ping #18317
2022-09-27 17:04:44 +00:00
..
crypt dot11decrypt: explicitly cast *pmk_len and msk_len 2022-06-03 23:13:34 +00:00
dfilter dfilter: Fix crash with FT_NONE and arithmetic expressions 2022-07-28 16:50:09 +00:00
dissectors OSSP: Update ESMC dissection to match current recommendation 2022-09-27 11:52:02 +00:00
ftypes Add some UTF-8 debug checks with a compile time flag 2022-09-27 17:04:44 +00:00
wslua Clarify dissector description, protocol short name, and protocol ong name. 2022-09-13 00:47:24 -07:00
.editorconfig epan: Normalize conversation code indentation. 2022-05-09 10:50:17 -07:00
CMakeLists.txt Make it easier to call tools/make-enums.py from the source dir 2022-06-07 14:31:08 +01:00
addr_and_mask.c
addr_and_mask.h epan/addr_and_mask.h: Document functions 2021-12-13 12:42:04 +00:00
addr_resolv.c epan: Update our name resolution preference names. 2022-08-04 06:00:34 +00:00
addr_resolv.h Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
address.h epan: Use host byte order with AT_NUMERIC 2022-06-23 16:58:07 +01:00
address_types.c epan: Prevent buffer overflows in some built-in addr_to_str types 2022-07-05 21:56:54 +00:00
address_types.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
afn.c
afn.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
aftypes.c
aftypes.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
app_mem_usage.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
app_mem_usage.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
arcnet_pids.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
arptypes.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
asn1.c
asn1.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ax25_pids.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
bridged_pids.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
capture_dissectors.c
capture_dissectors.h
charsets.c
charsets.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
chdlctypes.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
cisco_pid.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
color_filters.c Fix "generated by" comments in configuration files. 2022-04-29 18:00:21 +00:00
color_filters.h Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
column-info.h epan: Rearrange column includes 2022-08-13 19:37:28 +00:00
column-utils.c column-utils: Add missing check for frame_data::has_ts 2022-03-04 12:03:36 +00:00
column-utils.h epan: Rearrange column includes 2022-08-13 19:37:28 +00:00
column.c epan: Rearrange column includes 2022-08-13 19:37:28 +00:00
column.h epan: Rearrange column includes 2022-08-13 19:37:28 +00:00
conv_id.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
conversation.c conversation: bring back conversation_pt_to_endpoint_type(). 2022-09-02 00:07:53 -07:00
conversation.h conversation: bring back conversation_pt_to_endpoint_type(). 2022-09-02 00:07:53 -07:00
conversation_debug.h epan: Normalize conversation code indentation. 2022-05-09 10:50:17 -07:00
conversation_filter.c epan: Add the ability to add conversation filter protocols. 2022-04-19 22:25:32 +00:00
conversation_filter.h Fix a documentation warning. 2022-04-26 19:12:11 +00:00
conversation_table.c Rename a bunch of things with "conversation". 2022-08-25 20:02:20 -07:00
conversation_table.h Rename a bunch of things with "conversation". 2022-08-25 20:02:20 -07:00
crc6-tvb.c
crc6-tvb.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc8-tvb.c
crc8-tvb.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
crc10-tvb.c
crc10-tvb.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc16-tvb.c
crc16-tvb.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc32-tvb.c
crc32-tvb.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
dccpservicecodes.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
decode_as.c Clarify dissector description, protocol short name, and protocol ong name. 2022-09-13 00:47:24 -07:00
decode_as.h
diam_dict.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
diam_dict.l epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
disabled_protos.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
disabled_protos.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
dtd.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
dtd_grammar.lemon
dtd_parse.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
dtd_parse.l
dtd_preparse.l epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
dvb_chartbl.c
dvb_chartbl.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
eap.h EAP: add PEAP decoder 2022-04-30 13:30:20 +00:00
eapol_keydes_types.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
epan.c epan: Rearrange column includes 2022-08-13 19:37:28 +00:00
epan.h epan: Add a post_init() plugin routine 2022-06-02 14:11:17 +00:00
epan_dissect.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
etypes.h MeshConnex (MCX): MCX packet decode logic 2021-12-02 17:05:21 +05:30
ex-opt.c
ex-opt.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
except.c except: update some coments. 2022-01-11 21:05:35 -08:00
except.h epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
exceptions.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
exntest.c
expert.c Expert info: "Ok" is not valid severity level 2022-02-25 02:35:17 +00:00
expert.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
export_object.c
export_object.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
exported_pdu.c Dissector names are not protocol names. 2022-09-10 22:37:11 -07:00
exported_pdu.h Dissector names are not protocol names. 2022-09-10 22:37:11 -07:00
filter_expressions.c
filter_expressions.h
follow.c follow: Have followers register their stream count function 2022-09-14 00:03:07 +00:00
follow.h follow: Have followers register their stream count function 2022-09-14 00:03:07 +00:00
frame_data.c Revert "epan: Allow nested dependent packets" 2022-03-28 12:40:21 +00:00
frame_data.h Revert "epan: Allow nested dependent packets" 2022-03-28 12:40:21 +00:00
frame_data_sequence.c Revert "epan: Allow nested dependent packets" 2022-03-28 12:40:21 +00:00
frame_data_sequence.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
funnel.c
funnel.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
golay.c
golay.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
guid-utils.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
guid-utils.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
iana_charsets.c
iana_charsets.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
iax2_codec_type.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
in_cksum.c
in_cksum.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
introspection-enums.c epan: Refactor floating point display types 2022-08-02 13:16:46 +00:00
introspection.c epan: Add binary search to introspection API 2021-11-27 14:31:53 +00:00
introspection.h Add files with WS_DLL_PUBLIC to Doxygen part2 2021-11-30 06:47:35 +00:00
ip_opts.h
ipproto.c
ipproto.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ipv4.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ipv6.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
lapd_sapi.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
llcsaps.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
maxmind_db.c win32-utils: Explicitly list inherited handles 2022-08-16 20:53:22 +02:00
maxmind_db.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
media_params.c
media_params.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
next_tvb.c
next_tvb.h Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
nlpid.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
oids.c Move wmem string utility functions to wsutil 2021-12-19 10:47:50 +00:00
oids.h Fix more repeated words throughout 2021-12-31 22:50:40 +00:00
oids_test.c
osi-utils.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
osi-utils.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
oui.h ieee80211: Add dissector for Arista (Mojo) vendor specific IE 2022-08-16 14:08:15 +00:00
packet.c Clarify dissector description, protocol short name, and protocol ong name. 2022-09-13 00:47:24 -07:00
packet.h Clarify dissector description, protocol short name, and protocol ong name. 2022-09-13 00:47:24 -07:00
packet_info.h conversation: speak of the "conversation key" as just address/port endpoints. 2022-08-29 19:19:59 -07:00
params.h Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
pci-ids.c [Automatic update for 2022-09-11] 2022-09-11 19:29:51 +00:00
pci-ids.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
plugin_if.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
plugin_if.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ppptypes.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
prefs-int.h Prefs/Extcap: Added support for password which is never stored on the disk 2021-12-30 16:03:15 +00:00
prefs.c TCP: Use RFC 6994 for experimental options 2022-08-17 21:33:31 +00:00
prefs.h prefs: Remove prefs_register_decode_as_preference 2022-08-04 07:16:16 -04:00
print.c XML: Do escape ASCII control characters 2022-09-21 23:46:35 +00:00
print.h tshark: Add new long option --hexdump <hexoption> 2022-01-13 01:18:38 +00:00
print.ps
print_stream.c
print_stream.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
proto.c Add some UTF-8 debug checks with a compile time flag 2022-09-27 17:04:44 +00:00
proto.h proto: Validate add_string values as UTF-8 2022-09-21 07:53:01 -04:00
proto_data.c epan: Add p_set_proto_data. 2022-01-03 22:19:14 +00:00
proto_data.h epan: Add p_set_proto_data. 2022-01-03 22:19:14 +00:00
protobuf-helper.c
protobuf-helper.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
protobuf_lang_parser.lemon epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
protobuf_lang_scanner.l
protobuf_lang_tree.c Fix stdio.h conversions to use the scanf macros 2021-12-19 23:49:55 +00:00
protobuf_lang_tree.h epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
ps.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
ptvcursor.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
radius_dict.l epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
range.c epan: Constify a few range functions 2022-08-06 08:26:40 -04:00
range.h epan: Constify a few range functions 2022-08-06 08:26:40 -04:00
reassemble.c epan: Remove fragment_get_reassembled() 2022-06-14 00:59:34 +00:00
reassemble.h epan: Remove fragment_get_reassembled() 2022-06-14 00:59:34 +00:00
reassemble_test.c Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
reedsolomon.c
reedsolomon.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
register-int.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
register.c register.c: Avoid potential race condition (Coverity 1477510) 2022-06-29 11:21:25 -04:00
register.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
req_resp_hdrs.c HTTP: Speed up chunked Transfer-Encoding on TCP 2022-08-10 05:31:36 +00:00
req_resp_hdrs.h HTTP: Speed up chunked Transfer-Encoding on TCP 2022-08-10 05:31:36 +00:00
rtd_table.c
rtd_table.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
rtp_pt.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
sctpppids.c GDT: add dissector for SCTP PPID 49 protocol 2022-02-07 20:20:43 +00:00
sctpppids.h GDT: add dissector for SCTP PPID 49 protocol 2022-02-07 20:20:43 +00:00
secrets.c Windows: Upgrade libgcrypt to 1.10.1. 2022-08-19 18:30:16 -07:00
secrets.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
sequence_analysis.c epan: Rearrange column includes 2022-08-13 19:37:28 +00:00
sequence_analysis.h epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
show_exception.c exceptions: Add an expert warning for FragmentBoundsError 2022-04-06 07:17:14 -04:00
show_exception.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
slow_protocol_subtypes.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
sminmpec.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
srt_table.c
srt_table.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
stat_groups.h wslua: Port make-init-lua to Python3 2022-06-27 16:28:36 +00:00
stat_tap_ui.c
stat_tap_ui.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
stats_tree.c tap: Adding flags for tap_packet 2022-06-10 05:46:15 +00:00
stats_tree.h tap: Adding flags for tap_packet 2022-06-10 05:46:15 +00:00
stats_tree_priv.h tap: Adding flags for tap_packet 2022-06-10 05:46:15 +00:00
stream.c
stream.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
strutil.c XML: Do escape ASCII control characters 2022-09-21 23:46:35 +00:00
strutil.h strutil.h: Fix function description. 2022-09-07 08:31:20 +02:00
t35.c
t35.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
tap-voip.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
tap.c tap: Mark filtered packets instead of dropping them 2022-06-10 09:17:52 +02:00
tap.h tap: Mark filtered packets instead of dropping them 2022-06-10 09:17:52 +02:00
tfs.c NAS EPS: upgrade dissector to v17.7.0 2022-09-23 19:41:07 +02:00
tfs.h NAS EPS: upgrade dissector to v17.7.0 2022-09-23 19:41:07 +02:00
timestamp.c
timestamp.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
timestats.c
timestats.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
to_str.c dfilter: Add support for entering time in UTC 2021-12-30 17:53:09 +00:00
to_str.h dfilter: Add support for entering time in UTC 2021-12-30 17:53:09 +00:00
tvbparse.c
tvbparse.h Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
tvbtest.c
tvbuff-int.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
tvbuff.c Fix bogus tvbuffs to make sure reported length >= captured length. 2022-09-03 21:04:55 +00:00
tvbuff.h Fix bogus tvbuffs to make sure reported length >= captured length. 2022-09-03 21:04:55 +00:00
tvbuff_base64.c
tvbuff_brotli.c
tvbuff_composite.c TVB composite: allow to append/prepend a NULL tvb 2022-02-25 08:55:54 +00:00
tvbuff_lz77.c TVB: Don't uncompress zero sized buffers 2022-01-19 05:19:45 +00:00
tvbuff_lz77huff.c TVB: Don't uncompress zero sized buffers 2022-01-19 05:19:45 +00:00
tvbuff_lznt1.c TVB: Don't uncompress zero sized buffers 2022-01-19 05:19:45 +00:00
tvbuff_rdp.c Fix -Wmissing-prototypes found by Clang 2022-07-15 13:45:52 +00:00
tvbuff_rdp.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
tvbuff_real.c
tvbuff_subset.c epan: Handle subset tvbuffs with non-zero offets and length -1 2022-08-21 15:21:24 +00:00
tvbuff_zlib.c
uat-int.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
uat.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
uat.h Update uat.h 2022-09-07 13:47:09 +00:00
uat_load.l UAT: Fix Wireshark crash on missing UAT columns 2022-01-03 08:45:17 +00:00
unit_strings.c
unit_strings.h
value_string.c Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
value_string.h Extended range_string to 64 bit 2022-01-05 09:14:46 +00:00
wmem_scopes.c
wmem_scopes.h epan: Document the epan, file, and packet scopes. 2022-05-18 21:08:05 +00:00
ws_printf.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
wscbor.c WSCBOR: Add checks for length and NULL 2022-02-08 10:12:56 +00:00
wscbor.h Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
wscbor_test.c
x264_prt_id.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
xdlc.c epan: Convert to use stdio.h from GLib 2021-12-19 19:29:53 +00:00
xdlc.h