From: Günther Deschner Date: Mon, 27 Apr 2009 16:47:41 +0000 (+0200) Subject: s3-auth-charcnv: fix push_string(). Don't push to ucs2 and ascii after another. X-Git-Tag: tdb-1.1.5~882 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9805878e242d0d279f340b4a1fd084c77f240b1;p=thirdparty%2Fsamba.git s3-auth-charcnv: fix push_string(). Don't push to ucs2 and ascii after another. This fixes all kinds of encrypted passwords used in the shared auth code naturally. Andrew B., please check. Guenther --- diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index eb794d8347f..b94566863c5 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -1672,8 +1672,9 @@ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags) if (!(flags & STR_ASCII) && \ (flags & STR_UNICODE)) { ret = push_ucs2(NULL, dest, src, dest_len, flags); + } else { + ret = push_ascii(dest, src, dest_len, flags); } - ret = push_ascii(dest, src, dest_len, flags); if (ret == (size_t)-1) { return -1; }