summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-11-17 22:07:23 +0000
committerJeremy Allison <jra@samba.org>2003-11-17 22:07:23 +0000
commitc86a6b04c8fc279548f3a2a8fe638450c72e15c5 (patch)
tree906355ef561c4f1d9c7ebe26bbe811794a5a88f2 /source3/rpc_parse/parse_misc.c
parentbfbc3486045f819a3e7ac9c7460a8793d5a1f0e5 (diff)
downloadsamba-c86a6b04c8fc279548f3a2a8fe638450c72e15c5.tar.gz
samba-c86a6b04c8fc279548f3a2a8fe638450c72e15c5.tar.bz2
samba-c86a6b04c8fc279548f3a2a8fe638450c72e15c5.zip
Fix from Andrew Bartlett to fix up the munged-dial problem.
Jeremy. (This used to be commit 5df3d16c9226bf884226e8302b996a484017f8c3)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index cd59d390aa..7cd3c795e6 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -1043,7 +1043,11 @@ void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob)
str->uni_str_len = blob->length / sizeof(uint16);
str->uni_max_len = str->uni_str_len;
str->offset = 0;
- str->buffer = (uint16 *) memdup(blob->data, blob->length);
+ if (blob->length) {
+ str->buffer = (uint16 *) memdup(blob->data, blob->length);
+ } else {
+ str->buffer = NULL;
+ }
if ((str->buffer == NULL) && (blob->length > 0)) {
smb_panic("init_unistr2_from_datablob: malloc fail\n");
}