2.11.2.2 Safe/Unsafe Encoding Names
The idea of safe or unsafe encoding names specified by
TPMBENC
comes from whether or not the multibyte
character data for these encodings can contain embedded NULLs.
Because the _mbspresend()
function uses
strlen()
to determine the length of the data, an
embedded NULL causes the length to be incorrectly set and the wrong
number of data bytes are sent.
The default list in sendlen0_unsafe_tpmbenc
has the
multibyte Unicode encoding names (in uppercase and lowercase, for
convenience) which can contain embedded NULLs. You should modify
this list as application administration or performance is
considered.
- If the file exists but is empty, then Tuxedo assumes all
encoding names are safe for
MBSTRING
self-describing attempts. - If the file does not exist, then Tuxedo assumes that all
encoding names are unsafe to use for
MBSTRING
self-describing attempts (tperrno
will beTPEINVAL
). - If the file exists and contains a list of names, then Tuxedo
reads this file once (at
_mbsinit()
) and stores the list internally. Duringmbsinit()
, theTPMBENC
name is compared to the stored list and the buffer is set as safe or unsafe to use. When_mbspresend()
is called (sendlen
argument is set to zero) and the buffer is marked safe, then the length is set internally by Tuxedo.
Parent topic: Enabling MBSTRING to be Self-describing