summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-13 03:17:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:33:22 -0500
commitd452cd061cbc8a1a4fcf78139fd5386800f4f48d (patch)
treeb11ffea8ebf4b7b8d5515678117c321c52948327
parent1774019fc27869f01808ad8b0f8f85d03492d4b0 (diff)
downloadsamba-d452cd061cbc8a1a4fcf78139fd5386800f4f48d.tar.gz
samba-d452cd061cbc8a1a4fcf78139fd5386800f4f48d.tar.bz2
samba-d452cd061cbc8a1a4fcf78139fd5386800f4f48d.zip
r9300: cope with zero length in ndr_pull_charset()
(This used to be commit 1ae255aba44f4444486ae5bc634c8ab1a6328c87)
-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,