diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-04-04 04:16:02 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:00:13 -0500 |
commit | c1a9486fafd4a47f1fb4adaeb564ab759137d05f (patch) | |
tree | fcdb4ae749ed02c21f47b04f8c41b15a4d9f4d56 /source4 | |
parent | 6312201a435ab303807f0b137f28893ddb93b4f8 (diff) | |
download | samba-c1a9486fafd4a47f1fb4adaeb564ab759137d05f.tar.gz samba-c1a9486fafd4a47f1fb4adaeb564ab759137d05f.tar.bz2 samba-c1a9486fafd4a47f1fb4adaeb564ab759137d05f.zip |
r14904: fixed LIBNDR_FLAG_STR_CHARLEN (thanks to Metze for noticing this)
(This used to be commit 9569bf5374f92815ce1940f752aaff4a6913b4c0)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/ndr/ndr_string.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c index 33d23ce7dc..80b900211d 100644 --- a/source4/librpc/ndr/ndr_string.c +++ b/source4/librpc/ndr/ndr_string.c @@ -315,7 +315,7 @@ _PUBLIC_ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const cha flags &= ~LIBNDR_FLAG_STR_UTF8; } - flags &= ~(LIBNDR_FLAG_STR_CONFORMANT | LIBNDR_FLAG_STR_CHARLEN); + flags &= ~LIBNDR_FLAG_STR_CONFORMANT; if (!(flags & LIBNDR_FLAG_STR_NOTERM)) { s_len++; @@ -329,6 +329,9 @@ _PUBLIC_ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const cha if (flags & LIBNDR_FLAG_STR_BYTESIZE) { c_len = d_len; flags &= ~LIBNDR_FLAG_STR_BYTESIZE; + } else if (flags & LIBNDR_FLAG_STR_CHARLEN) { + c_len = (d_len / byte_mul)-1; + flags &= ~LIBNDR_FLAG_STR_CHARLEN; } else { c_len = d_len / byte_mul; } |