summaryrefslogtreecommitdiff
path: root/source4/lib/tdr
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-03 22:56:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:36:29 -0500
commit6a2c9e729fc8f576eacb7518d379839edf25d4e1 (patch)
tree39c0c748ddb2b67cc5be117ece417f37aa49c047 /source4/lib/tdr
parente9b5bf90e646af31c23631d08a73dcc8adca456e (diff)
downloadsamba-6a2c9e729fc8f576eacb7518d379839edf25d4e1.tar.gz
samba-6a2c9e729fc8f576eacb7518d379839edf25d4e1.tar.bz2
samba-6a2c9e729fc8f576eacb7518d379839edf25d4e1.zip
r10013: Support zero-sized strings.
(This used to be commit cf3be71c33ec8e43c883ce05fd1a63d1178446ad)
Diffstat (limited to 'source4/lib/tdr')
-rw-r--r--source4/lib/tdr/tdr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/tdr/tdr.c b/source4/lib/tdr/tdr.c
index e55060da25..7f42d0cf15 100644
--- a/source4/lib/tdr/tdr.c
+++ b/source4/lib/tdr/tdr.c
@@ -143,6 +143,11 @@ NTSTATUS tdr_pull_charset(struct tdr_pull *tdr, const char **v, uint32_t length,
}
}
+ if (length == 0) {
+ *v = talloc_strdup(tdr, "");
+ return NT_STATUS_OK;
+ }
+
TDR_PULL_NEED_BYTES(tdr, el_size*length);
ret = convert_string_talloc(tdr, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v));