s3: Fix the charset_pull routine (bug 7531)
authorVolker Lendecke <vl@samba.org>
Mon, 6 Sep 2010 13:13:48 +0000 (15:13 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 20 Sep 2010 04:33:25 +0000 (21:33 -0700)
In the push routine we do the SVAL, so we should do the SSVAL here.

lib/util/charset/charset.h

index 68907aa59303d4a05236311d73d05ae5e104ccf6..bd08f7efd9dc3ea5e5dbe7aa0fe1867cfee37509 100644 (file)
@@ -266,7 +266,7 @@ static size_t CHARSETNAME ## _pull(void *cd, const char **inbuf, size_t *inbytes
                         char **outbuf, size_t *outbytesleft)                                   \
 {                                                                                              \
        while (*inbytesleft >= 1 && *outbytesleft >= 2) {                                       \
-               *(uint16*)(*outbuf) = to_ucs2[((unsigned char*)(*inbuf))[0]];                   \
+               SSVAL(*outbuf, 0, to_ucs2[((unsigned char*)(*inbuf))[0]]);                      \
                (*inbytesleft)  -= 1;                                                           \
                (*outbytesleft) -= 2;                                                           \
                (*inbuf)  += 1;                                                                 \