wireshark/wsutil
Guy Harris ff9e2494a1 json_dumper: rework the error checking to improve error messages.
Fix the file name in the introductory comment.

Update a comment to note that a base64 value is handled, in some ways,
like a nested element, even though it's not nested in the way that an
object or array is.

Have json_dumper_bad() write current stack depth and the current and
previous types in, if possible, symbolic or numeric form; don't dump
other information.  Also have it set JSON_DUMPER_FLAGS_ERROR, so no
other routine needs to do so.

Add routines to check for dumper stack overflow *and* underflow and
report them with appropriate messages, and use them in routines that
push onto or pop off of that stack, respectively.

This means that the stack depth won't overflow or underflow, so we can
make it unsigned (as it will never underflow below 0) and don't need to
check for negative or bigger-than-the-stack values.

Pull check out of json_dumper_check_state() into various existing or new
routines (for common code to call in those existing routines), and have
the error messages passed to json_dumper_bad() give a more detailed
explanation of the particular problem detected.
2023-03-08 05:06:25 -08:00
..
wmem CMake: Remove unnecessary wmem object library 2023-02-12 13:25:44 +00:00
.editorconfig Convert unicode-utils.[ch] to 4-space indentation 2023-02-06 15:03:49 +00:00
802_11-utils.c wsutil: Use snprintf() and ws_strdup_printf() 2021-12-19 12:23:14 +00:00
802_11-utils.h wsutil: Use snprintf() and ws_strdup_printf() 2021-12-19 12:23:14 +00:00
CMakeLists.txt Enable rpathification and working relocation on Linux (take 3) 2023-02-13 00:24:21 +00:00
adler32.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
adler32.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
base32.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
base32.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
bits_count_ones.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
bits_ctz.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
bitswap.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
bitswap.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
buffer.c wsutil: Use snprintf() and ws_strdup_printf() 2021-12-19 12:23:14 +00:00
buffer.h Correct function signatures for buffer functions 2023-02-07 19:52:37 +00:00
cfutils.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
cfutils.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
clopts_common.c Move ui/clopts_common.[ch] to wsutil 2023-02-10 20:59:22 +00:00
clopts_common.h Move ui/clopts_common.[ch] to wsutil 2023-02-10 20:59:22 +00:00
cmdarg_err.c Move ui/cmdarg_err.[ch] to wsutil 2023-02-10 20:59:22 +00:00
cmdarg_err.h Move ui/cmdarg_err.[ch] to wsutil 2023-02-10 20:59:22 +00:00
codecs.c wsutil: Fix incorrect header include 2021-06-25 03:14:22 +00:00
codecs.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
color.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
console_win32.c Windows: Store "gui.console_open" in the Windows registry 2022-10-11 14:25:04 +01:00
console_win32.h Windows: Store "gui.console_open" in the Windows registry 2022-10-11 14:25:04 +01:00
cpu_info.c version info: Strip whitespace from a string 2023-01-11 18:52:06 +00:00
cpu_info.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crash_info.c Add missing header, fix macOS build 2021-12-19 19:09:05 +00:00
crash_info.h Add missing header, fix macOS build 2021-12-19 19:09:05 +00:00
crc5.c USBLL: Verify Token/Split packets CRC-5 2019-07-29 20:49:09 +00:00
crc5.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc6.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc6.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc7.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc7.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc8.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc8.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc10.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc10.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc11.c Fix -Wdocumentation warning 2021-04-14 14:01:49 +00:00
crc11.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc16-plain.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc16-plain.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc16.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc16.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
crc32.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
crc32.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
curve25519.c Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
curve25519.h Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
dot11decrypt_wep.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
eax.c Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
eax.h Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
epochs.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
exported_pdu_tlvs.h Add Management Component Transport Protocol (MCTP) dissector 2022-11-15 09:05:05 +00:00
feature_list.c Windows: Fix build 2022-02-24 20:29:04 +00:00
feature_list.h wsutil: New API to gather compile/runtime info 2022-02-24 13:27:08 +00:00
file_util.c MinGW: Fix -Wold-style-declaration 2023-01-13 22:41:04 +00:00
file_util.h extcap: Close pipe on windows properly 2022-05-16 14:48:37 +02:00
filesystem.c Add a #define HAVE_MSYSTEM and use it 2023-02-06 19:39:33 +00:00
filesystem.h Fix Personal Extcap folder path 2023-01-20 22:30:26 +00:00
filter_files.c Move ui/filter_files.[ch] to wsutil 2023-02-10 20:59:22 +00:00
filter_files.h Move ui/filter_files.[ch] to wsutil 2023-02-10 20:59:22 +00:00
g711.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
g711.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
glib-compat.h glib: Bump required version to 2.50 2022-04-22 12:55:37 +00:00
inet_addr.c wsutil/inet_addr: Add a cast to squelch a narrowing warning 2021-12-27 23:11:51 +00:00
inet_addr.h wsutil/inet_addr: Refactor to use C99/POSIX types 2021-12-27 19:02:50 +00:00
inet_ipv4.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
inet_ipv6.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
interface.c Eliminate some unneeded header checks. 2018-05-16 22:03:09 +00:00
interface.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
introspection.c wiretap: Add enum generation 2022-10-07 10:28:47 +01:00
introspection.h wiretap: Add enum generation 2022-10-07 10:28:47 +01:00
jsmn.c wsutil: split libjsmn. 2016-09-30 20:12:00 +00:00
jsmn.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
json_dumper.c json_dumper: rework the error checking to improve error messages. 2023-03-08 05:06:25 -08:00
json_dumper.h json_dumper: rework the error checking to improve error messages. 2023-03-08 05:06:25 -08:00
mpeg-audio.c mpeg: handle the presence of an image in the ID3v2 header. 2022-03-10 07:38:14 +00:00
mpeg-audio.h mpeg: handle the presence of an image in the ID3v2 header. 2022-03-10 07:38:14 +00:00
nstime.c nstime: "localtime()" is an API, "local time" is local time. 2022-01-03 23:08:07 +00:00
nstime.h epan: Add back ABSOLUTE_TIME_NTP_UTC representation 2021-12-29 00:30:17 +00:00
os_version_info.c MinGW: Disable -Wcast-function-type warnings 2023-01-14 14:52:53 +00:00
os_version_info.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
path_config.h.in Add support for configuration path relocation on Unix 2023-01-26 18:43:20 +00:00
pint.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
please_report_bug.c Update our issue tracker URL in some places. 2020-09-16 01:29:07 +00:00
please_report_bug.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
plugins.c CMake: Cleanup unnecessary linking with shared libraries 2023-02-06 15:04:46 +00:00
plugins.h CMake: Cleanup unnecessary linking with shared libraries 2023-02-06 15:04:46 +00:00
pow2.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
privileges.c Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
privileges.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
processes.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
regex.c Convert capture file regex search to PCRE2. 2022-07-27 11:21:03 +00:00
regex.h Convert capture file regex search to PCRE2. 2022-07-27 11:21:03 +00:00
report_message.c Add more error-reporting routines that call through a function pointer. 2021-03-15 12:17:59 -07:00
report_message.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
rsa.c wsutil: Use snprintf() and ws_strdup_printf() 2021-12-19 12:23:14 +00:00
rsa.h Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
safe-math.h safe-math: Remove unnecessary clutter 2022-03-31 15:49:43 +01:00
sign_ext.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
sober128.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
sober128.h Add files with WS_DLL_PUBLIC to Doxygen part2 2021-11-30 06:47:35 +00:00
socket.c wsutil: Use snprintf() and ws_strdup_printf() 2021-12-19 12:23:14 +00:00
socket.h wsutil: Use snprintf() and ws_strdup_printf() 2021-12-19 12:23:14 +00:00
str_util.c wmem: Remove strbuf max size parameter 2022-12-03 01:54:52 +00:00
str_util.h IAX2: Fix UTF-8 string encoding 2022-11-18 11:32:13 +00:00
strnatcmp.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
strnatcmp.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
strptime.c MinGW: Fix warnings wiht ws_strptime() 2023-01-14 14:52:53 +00:00
strptime.h Use a wrapper function to call strptime() 2021-12-27 14:07:32 +00:00
strtoi.c Replace g_assert() with ws_assert() in places 2021-06-06 20:05:26 +00:00
strtoi.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
tempfile.c Extcap: Create our fifo in a temporary directory. 2022-12-12 18:34:21 +00:00
tempfile.h Extcap: Create our fifo in a temporary directory. 2022-12-12 18:34:21 +00:00
test_wsutil.c Move format_text() to libwsutil and add unit tests 2022-09-28 21:44:27 +00:00
time_util.c Use a wrapper function to call strptime() 2021-12-27 14:07:32 +00:00
time_util.h Use a wrapper function to call strptime() 2021-12-27 14:07:32 +00:00
to_str.c Corrects repeated words throughout the code. 2021-12-22 11:01:11 +00:00
to_str.h Add files with WS_DLL_PUBLIC to Doxygen part2 2021-11-30 06:47:35 +00:00
type_util.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
type_util.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
unicode-utils.c Replace g_utf8_make_valid() with own function 2023-02-08 11:21:19 +00:00
unicode-utils.h Replace g_utf8_make_valid() with own function 2023-02-08 11:21:19 +00:00
utf8_entities.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
version_info.c Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
version_info.h Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
win32-utils.c MinGW: Fix -Wsign-compare 2023-01-13 22:41:04 +00:00
win32-utils.h win32-utils: Explicitly list inherited handles 2022-08-16 20:53:22 +02:00
ws_assert.h CMake: Reverse debug macros 2023-01-12 00:59:15 +00:00
ws_cpuid.h cpuid: clean up, update. and expand some comments. 2022-06-01 00:42:47 -07:00
ws_getopt.c Add a #define for REPLACEMENT CHARACTER and use it. 2022-10-16 23:36:12 +00:00
ws_getopt.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ws_mempbrk.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
ws_mempbrk.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
ws_mempbrk_int.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
ws_mempbrk_sse42.c Fix many spelling errors 2020-10-11 08:35:55 +00:00
ws_pipe.c MinGW: Fix -Wformat 2023-01-13 15:48:03 +00:00
ws_pipe.h wsutil: Remove flawed ws_pipe_close() function 2022-08-14 16:05:22 +00:00
ws_return.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
ws_roundup.h wsutil: Add header files to Doxygen 2021-11-30 07:30:34 +00:00
wsgcrypt.c libgcrypt: Require version 1.8.0 2022-04-20 21:30:21 -04:00
wsgcrypt.h Do not require using wsgcrypt.h 2023-02-06 15:52:10 +00:00
wsjson.c NGAP: fix dissection of multiple NGAP messages in the same HTTP2 packet 2021-06-21 13:33:55 +00:00
wsjson.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00
wslog.c Draft: wslog: simplify log domain tokenize 2023-02-24 22:13:02 +00:00
wslog.h CMake: Reverse debug macros 2023-01-12 00:59:15 +00:00
xtea.c HTTPS (almost) everywhere. 2019-07-26 18:44:40 +00:00
xtea.h Add files with WS_DLL_PUBLIC to Doxygen 2021-11-29 21:27:45 +00:00