summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-03-12 02:58:22 +0000
committerJeremy Allison <jra@samba.org>2002-03-12 02:58:22 +0000
commit174b75cc7eaa3c94d0d575dbccfd17490f3dc981 (patch)
tree55c241fb41b831009e8a81ad7fe6aa143e8f0bb8
parent9deb403520d6265a38bcfc2c314b5f70ff2e5dc8 (diff)
downloadsamba-174b75cc7eaa3c94d0d575dbccfd17490f3dc981.tar.gz
samba-174b75cc7eaa3c94d0d575dbccfd17490f3dc981.tar.xz
samba-174b75cc7eaa3c94d0d575dbccfd17490f3dc981.zip
Fixup parsing of domain name from packet in enum_domains.
Jeremy
-rw-r--r--source/lib/util_unistr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c
index c044e8f248c..d11bb0657bb 100644
--- a/source/lib/util_unistr.c
+++ b/source/lib/util_unistr.c
@@ -2053,6 +2053,7 @@ int rpcstr_pull(char* dest, void *src, int dest_len, int src_len, int flags)
{
if(dest_len==-1)
dest_len=MAXUNI-3;
- unistr_to_ascii(dest, src, dest_len - 1);
+ dest_len = MIN((src_len/2), (dest_len-1));
+ unistr_to_ascii(dest, src, dest_len);
return src_len;
}