Reduce the amount of platform specific Wireshark code by using
GIOChannel watch, i.e. do not use UNIX specific GLib functionality and
do not peek into pipe every 100 ms on Windows.
WOW has several 4 octet ASCII strings in reverse order. g_strreverse
does not work on UTF-8 multibyte characters, such as REPLACEMENT
CHARACTER when there are errors. Reverse the string buffer before
converting from ASCII.
Fix#18529
Addresses clang-analyzer warning:
"packet-couchbase.c:2636:7: warning: Value stored to 'offset' is never read"
Change-Id: Ib91fbd64e08f65cbe83887ebdf5b6ae545672bc5
The RPM packages use a versioned build directory, which creates problems
for ccache. The APT packages simply take a long time to build. Switch
both to a twice-daily schedule so that we don't set fire to CI minutes
in parallel with every merge.
Back out a recent CMake change since it's no longer needed.
For EMI and UCP, the encoding for alphanumeric messages, as
specified in ETS 300 133-3 as well as the EMI extension
specification, is rather unique: GSM 7-bit alphabet characters
are each translated (thus unpacked) to two hex byte IRA characters
(same as ASCII over the 0-9 A-F range), with '/' used as an
end of string indicator.
Translate the hex bytestring to bytes, and then convert the bytes
using the unpacked GSM 7-bit alphabet instead of treating them
as ASCII or UTF-8. Check for invalid bytes which are not ASCII hex
and replace them in the final returned string with the UTF-8
replacement character. Fix#18518 better.
This commit adds support for requests of:
* RangeScan create (with a JSON value)
* RangeScan continue (with binary extras)
* RangeScan cancel (with binary extras)
And support for the RangeScan create response 128-bit uuid
949615071b/docs/range_scans
Change-Id: Iea7a0bcaea82a22dd938247c71afc57b4a0869cf
The C language does not guarantee that "char" is signed or unsigned; it
just states that it's "implementation-dependent".
At least some C compilers for some architectures make it unsigned, so
you need "signed char" to get a signed value. In particular, it's
unsigned for most ARM compilers (compilers for Darwin-based OSes such as
macOS make it signed on all platforms, including ARM), which causes a
warning about "ba[i] < '\0'" always being false.
The purpose of that test is to check for octets that correspond neither
to ASCII printable characters nor ASCII control characters; just test
with !g_ascii_isprint(ba[i]) && !g_ascii_iscntrl(ba[i]). (Those are
macros, so it's not as if that adds any subroutine call overhead.)
Add some comments to explain what's being done in
ShowPacketBytesDialog::symbolizeBuffer() while we're at it. (Not one of
the better uses of C++ polymorphism, giving "replace the octet at this
location with this sequence of octets" and "replace all octets equal to
this value with this sequence of octets" the same name, even though what
they do differs significantly. I would have called one replace_at and
the other replace_all or something such as that, but the Qt developers
didn't ask me....)
Add an RPMBUILD_EXTRA_ARGS variable to CMakeLists.txt and use it in
GitLab CI to define __cmake_builddir. This should let ccache work with
our RPM builds.
hex_str_to_bytes_encoding() consumes pairs of hex digits (and
optional separator) to turn into bytes. It can return a pointer
to the character after the last digit consumed. Don't advance
the end pointer after a single unpaired digit that is not consumed
as part of the hex string returned.
tvb_get_string_bytes() can pass back the end offset. If conversion
fails, return the initial offset instead of zero to make repeated
calls easier in cases where the full length is not decoded due to
errors.
Relatedly, no dissector currently uses this return value, because
it's not useful currently.
GitLab CI builds RPMs in a different directory for each pipeline
($CI_PROJECT_DIR/build/packaging/rpm/BUILD/wireshark-<version>), so set
base_dir to the build directory and enable absolute_paths_in_stderr.
Fix our cache directory max sizes as well.
The proto.h APIs expect valid UTF-8 so replace uses of format_text()
with a label copy function that just does formatting and does not
check for encoding errors. Avoid multiple levels of temporary
string allocations.
Make sure the copy does not truncate a multibyte character and
produce invalid strings. Add debug checks for UTF-8 encoding errors
instead.
We escape C0 and C1 control codes (because control codes)
and ASCII whitespace (and bell).
Overall the goal is to be more efficient and optimized and help
detect misuse of APIs by passing invalid UTF-8.
Add a unit test for ws_label_strcat.
Use the setup_frame_number to look for and create conversations
with srtcp_add_address, the same way as done in srtp_add_address.
This ensures that RTP and RTCP find the same conversation when
called back to back (as when handling them multiplexed on the
same conversation.
Related to #18460.
As far as I can tell, get_unicode_or_ascii_string() always
nul-terminates string (as it should), so remove g_strlcpy()
copy that can truncate string and produce invalid UTF-8.