summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-01-11 02:53:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:51 -0500
commit08a9d98cdecfd8cac2a5b72130e30a711eddb050 (patch)
treee5d76be8fea36562310cadb7c59bc4321b929801 /source3/rpc_parse
parentd16a5c4381397efa7f4de2d8c7e9299bec492eb8 (diff)
downloadsamba-08a9d98cdecfd8cac2a5b72130e30a711eddb050.tar.gz
samba-08a9d98cdecfd8cac2a5b72130e30a711eddb050.tar.bz2
samba-08a9d98cdecfd8cac2a5b72130e30a711eddb050.zip
r4668: allow the caller to invoke init_unistr2() with a NULL buffer to match previous behavior; more checks to come tomorrow
(This used to be commit 9a29bef056f92ef6f1df01f56c121088f84be16b)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_misc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index b53f9ec98c..bca40a64c8 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -895,7 +895,15 @@ void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags)
if (buf) {
/* We always null terminate the copy. */
len = strlen(buf) + 1;
+ } else {
+ /* no buffer -- nothing to do */
+ str->uni_max_len = 0;
+ str->offset = 0;
+ str->uni_str_len = 0;
+
+ return;
}
+
str->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, len);
if (str->buffer == NULL) {