summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/librpc/ndr/ndr_string.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c
index 11397aaafd..50fa887a34 100644
--- a/source4/librpc/ndr/ndr_string.c
+++ b/source4/librpc/ndr/ndr_string.c
@@ -621,6 +621,10 @@ NTSTATUS ndr_check_string_terminator(struct ndr_pull *ndr, const void *_var, uin
NTSTATUS ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, int chset)
{
int ret;
+ if (length == 0) {
+ *var = talloc_strdup(ndr, "");
+ return NT_STATUS_OK;
+ }
NDR_PULL_NEED_BYTES(ndr, length*byte_mul);
ret = convert_string_talloc(ndr, chset, CH_UNIX,
ndr->data+ndr->offset,