The branch, master has been updated
       via  11a3d78 librpc/ndr: correctly implement ndr_charset_length()
      from  fbf3d03 s3: Fix an uninitialized variable

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 11a3d78951c897c46264203daaad12a3ead5cf8c
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Aug 25 10:05:15 2010 +0200

    librpc/ndr: correctly implement ndr_charset_length()
    
    Before we ignored the charset type.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 librpc/ndr/ndr_string.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/ndr/ndr_string.c b/librpc/ndr/ndr_string.c
index 568c368..2e04633 100644
--- a/librpc/ndr/ndr_string.c
+++ b/librpc/ndr/ndr_string.c
@@ -714,7 +714,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_charset(struct 
ndr_push *ndr, int ndr_flags,
 /* Return number of elements in a string in the specified charset */
 _PUBLIC_ uint32_t ndr_charset_length(const void *var, charset_t chset)
 {
-       /* FIXME: Treat special chars special here, taking chset into account */
-       /* Also include 0 byte */
+       switch (chset) {
+       /* case CH_UTF16: this has the same value as CH_UTF16LE */
+       case CH_UTF16LE:
+       case CH_UTF16BE:
+       case CH_UTF16MUNGED:
+               return strlen_m_term((const char *)var);
+       case CH_DISPLAY:
+       case CH_DOS:
+       case CH_UNIX:
+       case CH_UTF8:
+               return strlen((const char *)var)+1;
+       }
+
+       /* Fallback, this should never happen */
        return strlen((const char *)var)+1;
 }


-- 
Samba Shared Repository

Reply via email to