From ffb53c35748154081c1587b5f167721e32ff10f2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 10 Jan 2009 17:59:43 +0100 Subject: Even for srclen == 0 we have to return something This fixes a regression reported by Corinna Vinschen Thanks, Volker --- source3/lib/charcnv.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 3ec3220900..c3b345142f 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -547,6 +547,12 @@ bool convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to, return false; } if (srclen == 0) { + ob = ((ctx != NULL) ? talloc_strdup(ctx, "") : SMB_STRDUP("")); + if (ob == NULL) { + errno = ENOMEM; + return false; + } + *dest = ob; *converted_size = 0; return true; } -- cgit