librpc: Change type of ‘u16string’ from ‘const uint16_t *’ to ‘const unsigned char *’
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 20 Dec 2023 22:51:19 +0000 (11:51 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 21 Dec 2023 23:48:46 +0000 (23:48 +0000)
commit346844b730b06fe5ad53dc93fc0f4d4470794cb5
treee1a70a0a5ec0b33107ce17c918c6feb5acc0c339
parent65db36ca327d10344566e2fb4330e19050d645ef
librpc: Change type of ‘u16string’ from ‘const uint16_t *’ to ‘const unsigned char *’

A u16string is supposed to contain UTF‐16 code units, but
ndr_pull_u16string() and ndr_push_u16string() fail to correctly ensure
this on big‐endian systems. Code that relies on the u16string array
containing correct values will then fail.

Fix ndr_pull_u16string() and ndr_push_u16string() to work on big‐endian
systems, ensuring that other code can use these strings without having
to worry about first encoding them to little‐endian.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/util/charset/charset.h
lib/util/charset/util_unistr.c
librpc/ABI/ndr-4.0.0.sigs
librpc/ndr/libndr.h
librpc/ndr/ndr_string.c
librpc/tests/test_ndr_gmsa.c
pidl/lib/Parse/Pidl/Samba4/Python.pm
pidl/lib/Parse/Pidl/Typelist.pm
source4/librpc/rpc/pyrpc_util.c
source4/librpc/rpc/pyrpc_util.h