From df3576f852ea6cd29f68fc3f172cd0b2989cdf5a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 2 Apr 2002 16:03:05 +0000 Subject: [PATCH] fix rpcclient parsing by make rpcstr_pull() determine the UNICODE string length if STR_TERMINIATE was set (just like HEAD). --- source/lib/util_unistr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c index bd0113b972b..a2bd0cf4913 100644 --- a/source/lib/util_unistr.c +++ b/source/lib/util_unistr.c @@ -2080,6 +2080,10 @@ int rpcstr_pull(char* dest, void *src, int dest_len, int src_len, int flags) { if(dest_len==-1) dest_len=MAXUNI-3; + + if (flags & STR_TERMINATE) + src_len = strlen_w(src)*2+2; + dest_len = MIN((src_len/2), (dest_len-1)); unistr_to_ascii(dest, src, dest_len); return src_len; -- 2.11.4.GIT