Merge of rpcstr_pull() termination fixes from 3.0
authorTim Potter <tpot@samba.org>
Wed, 28 May 2003 00:59:35 +0000 (00:59 +0000)
committerTim Potter <tpot@samba.org>
Wed, 28 May 2003 00:59:35 +0000 (00:59 +0000)
source/lib/util_unistr.c

index 08bb03986f145eb62868fb9c544e129163dc28ff..5df0828295f95ff8e5eec4fa617c6a152a575d16 100644 (file)
@@ -229,7 +229,10 @@ char *skip_unibuf(char *src, size_t len)
  */ 
 int rpcstr_pull(char* dest, void *src, int dest_len, int src_len, int flags)
 {
-       if (!src) return 0;
+       if (!src) {
+               dest[0] = 0;
+               return 0;
+       }
        if(dest_len==-1) dest_len=MAXUNI-3;
        return pull_ucs2(NULL, dest, src, dest_len, src_len, flags|STR_UNICODE|STR_NOALIGN);
 }