From 66468d23158694383f3759464ffa7ade1c1d6d6c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 23 Apr 2003 14:07:33 +0000 Subject: Patch by Metze to ensure that we always at least initialize our output string for rpc_pull_string. If we had a NULL or zero-length string, we would use uninitialised data in the result string. Andrew Bartlett (This used to be commit df10aee451b431a8a056a949a98393da256185da) --- source3/lib/util_unistr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/lib/util_unistr.c') diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 08bb03986f..5df0828295 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -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); } -- cgit