Rename tvb_get_nstringz0() to tvb_get_raw_bytes_as_stringz()
to reflect the fact that this function does not return
a string (UTF-8 internal text string).
Remove tvb_get_stringz() because it is unused and just seems
dangerous.
In PacketCable MTA capabilities, the length of the capability
is store as hex digits in ASCII. If bogus, the incorrect value
is added as an expert info. Ensure that it's formatted as UTF-8
and for display when added to the tree.
Fix#18437
3GPP came up with a special encoding of TDMA frame number, which reduces
the amount of bits needed to carry it from 32 to 16. This encoding is
not only employed on the radio interface (GSM RR), but also on the
A-bis/RSL interface which is used between BTS and BSC nodes.
From the user perspective, parsed RFN value is a lot more meaningful
than the T1/T2/T3 variables used on the wire. The GSM RR dissector
does show parsed RFN value together with these variables, while the RSL
dissector does not. Let's show it in the RSL dissector too.
In SMB2, the length of the buffer than contained a UTF-16
unicode string is not necessarily the length of the converted
UTF-8 string, and in some cases can even be shorter than the
length of the UTF-8 string, if the string has many 2 octet
UTF-16 characters that are 3 or 4 octets in UTF-8.
Use wmem_strdup and wmem_strdup_printf instead of wmem_alloc
and sprintf, which is a safer pattern anyway as it reduces
the chance of these errors.
Fix#18482
By using strlcat later, we don't need to update pname_ret again,
since we only need the total size of the buffer. Elminates a
clang analyzer warning about writing a value that is never used
related to commit 9891a79137
Ensure that FTP doesn't add invalid strings to the tree or columns.
Also allow UTF-8 pathnames to work.
According to RFC 2640, FTP supports UTF-8 for pathnames (and it
MUST be supported even if the other side does not advertise support
for UTF-8, unless a different character set has been explicitly
configured, which is out of scope of the RFCs, and we don't have
such a preference.) So in general interpret strings as UTF-8, not
ASCII.
Reduce the use of tvb_get_ptr by using functions directly on the
original tvb and offset. This also happens to be more compliant
with RFC 2640 when getting the token lengths. (RFC 2640 states
that implementations MUST assume that there is only one space between
a command and the pathname, and treat additional spaces as part of
the pathname instead of skipping them. tvb_get_token_len() does not
skip trailing spaces, but get_token_len() does.)
The only place that still uses tvb_get_ptr is when processing a PWD
command, because it has to deal with the double quote escaping as
a custom encoding.
Add a tvb_ascii_isdigit function.
Fix#18439.
According to Rec. ITU-T H.265 7.3.7 and 7.4.8,
when there are multiple RPS in SPS,
RPS can be predicted from previous ones.
But NumDletaPocs used to be a local variable for each RPS,
prediction will always fail.
In this change, NumDletaPocs is moved from dissect_h265_st_ref_pic_set
to dissect_h265_seq_parameter_set_rbsp, to allow access to previous RPS
data.
This change also move each RPS into a subtree.
Fix#18481
Replace several instances in which a REPLACEMENT CHARACTER was being
appended to a wmem_strbuf with a call to
wmem_strbuf_append_unichar_repl().
This reduces the number of explicit 0x00fffd or 0xfffd or... in the
code.
Effective permitted-alphabet constraints are only PER-visible for
the known-multiplier character string types (X.691 27.1). When
PER-visible, the upper bound of any code point used in the
alphabet needs to be calculated, in particular for the ALIGNED
variant, because that determines whether or not canonical order
is used (X.691 27.5.2, 27.5.4).
Note that even with the change to asn2wrs.py none of the generated
dissectors change, because we don't have any example of ASN.1
with non-PER visible permitted alphabet constraints because of
using them on non known-multiplier character string types
(like UTF8String).
There's some various edge cases that we still don't handle, but
nothing that any of the ASN.1 modules in the repository use.
(Permitted-alphabet constraints using characters outside the
ASCII range, possibly with "CharacterStringList", "Quadruple",
or "Tuple" notation, permitted-alphabet constraints that are
extensible and thus not PER-visible, etc.)
Also fix a fencepost error with the length of the octets to highlight.
Fix#18468
Instead of trying to rewrite the validation of UTF-8 for the nth
time first extract a validated string from the parser with
tvb_get_string_enc() and then do the post-processing on that
(unescape, etc.).
I noticed while implementing the equivalent for 802.11be that the number
of bits for phi and psi angles was reversed. Also, fixed the spelling of
AvgSNR.
Use UTF-8 replacement characters for characters outside the
restricted string domain. This is particularly important to
guarantee valid UTF-8 for values outside the ASCII range.
Fix#18423
RFC 1001 says that scope IDs "meet the restricted character set
of the domain system and has a leading period." Convert them from
ASCII (plus possible garbage fuzzed characters) to UTF-8. Also
check for truncation when appending them to the NetBIOS name.
Fix#18412
This change adds computed values for reports, sequence analysis between
segments, conversation and endpoint taps, and a new statistics menu
and dialog.
In SMB, display_unicode_string is used to handle null terminated
UTF-16LE strings. Do that with the normal API, instead of just
taking every other byte (which works for ASCII and nothing else.)
Do the same fix for the DirectPlay dissector, which borrowed the
code from SMB
Fix#18467.
The result of Base64 decoding might not be valid UTF-8, so
check it as such. Also add the decoded result as a new tvb data
source, so that it's easier to do other manipulations on it from
the GUI in case it isn't UTF-8.
Note that RFC 7617 says that the encoding is only known to be
UTF-8 if the charset parameter was used in the WWW-Authenticate
header, so perhaps this should be a FT_BYTES using
BASE_SHOW_UTF_8_PRINTABLE
Fix#18408
GMTLS is a non-official name, now that these is a Chinese National Standard called
"GB/T 38636-2020 Information security technology—Transport layer cryptography protocol(TLCP)"
so we replace GMTLS by TLCP