summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/bin/.cvsignore1
-rw-r--r--source3/include/rpc_misc.h2
-rw-r--r--source3/rpc_parse/parse_misc.c2
-rw-r--r--source3/rpc_server/srv_lsa_nt.c2
4 files changed, 4 insertions, 3 deletions
diff --git a/source3/bin/.cvsignore b/source3/bin/.cvsignore
index 31af1fe22d..013a5ba6c1 100644
--- a/source3/bin/.cvsignore
+++ b/source3/bin/.cvsignore
@@ -52,3 +52,4 @@ log2pcap
wbinfo
winbindd
wrepld
+tdbdump
diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h
index aaaad55c20..29ae212185 100644
--- a/source3/include/rpc_misc.h
+++ b/source3/include/rpc_misc.h
@@ -403,5 +403,5 @@ typedef struct buffer4_info
}
BUFFER4;
-enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2 };
+enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3 };
#endif /* _RPC_MISC_H */
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 7cd3c795e6..b34efa6667 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -942,7 +942,7 @@ void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags)
str->uni_max_len = num_chars;
str->offset = 0;
str->uni_str_len = num_chars;
- if (num_chars && (flags == UNI_MAXLEN_TERMINATE))
+ if ( num_chars && ((flags == UNI_MAXLEN_TERMINATE) || (flags == UNI_BROKEN_NON_NULL)) )
str->uni_max_len++;
}
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 8785cce789..01a31dcfe5 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -66,7 +66,7 @@ static void init_dom_query(DOM_QUERY *d_q, const char *dom_name, DOM_SID *dom_si
/* this string is supposed to be non-null terminated. */
/* But the maxlen in this UNISTR2 must include the terminating null. */
- init_unistr2(&d_q->uni_domain_name, dom_name, UNI_MAXLEN_TERMINATE);
+ init_unistr2(&d_q->uni_domain_name, dom_name, UNI_BROKEN_NON_NULL);
/*
* I'm not sure why this really odd combination of length