diff options
-rw-r--r-- | source4/librpc/ndr/ndr_string.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index 46f58c9788..5485f3ff5d 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -564,6 +564,10 @@ _PUBLIC_ NTSTATUS ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const ch return NT_STATUS_OK; } + if (NDR_BE(ndr) && chset == CH_UTF16) { + chset = CH_UTF16BE; + } + NDR_PULL_NEED_BYTES(ndr, length*byte_mul); ret = convert_string_talloc(ndr->current_mem_ctx, @@ -584,6 +588,10 @@ _PUBLIC_ NTSTATUS ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const ch { ssize_t ret, required; + if (NDR_BE(ndr) && chset == CH_UTF16) { + chset = CH_UTF16BE; + } + required = byte_mul * length; NDR_PUSH_NEED_BYTES(ndr, required); |