From 6a2c9e729fc8f576eacb7518d379839edf25d4e1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 3 Sep 2005 22:56:02 +0000 Subject: r10013: Support zero-sized strings. (This used to be commit cf3be71c33ec8e43c883ce05fd1a63d1178446ad) --- source4/lib/tdr/tdr.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib/tdr') 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)); -- cgit