s3:librpc/ndr: use new strlen_m_ext_term() in ndr_charset_length(): fix bug #7594
authorMichael Adam <obnox@samba.org>
Sun, 31 Oct 2010 00:04:25 +0000 (02:04 +0200)
committerKarolin Seeger <kseeger@samba.org>
Sat, 5 Mar 2011 13:34:31 +0000 (14:34 +0100)
This fixes the calculation of needed space for destination unicode charset.

The last 4 patches address bug #7594 ("wbinfo -u" and "wbinfo -g" gives no
output (log=>ndr_pull_error)).
(cherry picked from commit 8e46bff8b88103f4a5b0d3920ab6e3901decaf22)

source3/librpc/ndr/ndr_string.c

index 51b0d89b12780f2648d0257f8ebd5869b129d969..f0c3e47a19a25f29cfa076fdfc1d4fde8f946ba2 100644 (file)
@@ -719,11 +719,11 @@ _PUBLIC_ uint32_t ndr_charset_length(const void *var, charset_t chset)
        case CH_UTF16LE:
        case CH_UTF16BE:
        case CH_UTF16MUNGED:
-               return strlen_m_term((const char *)var);
+       case CH_UTF8:
+               return strlen_m_ext_term((const char *)var, chset);
        case CH_DISPLAY:
        case CH_DOS:
        case CH_UNIX:
-       case CH_UTF8:
                return strlen((const char *)var)+1;
        }