From eb980cd213c9e2b0dc72ffd3c80efd54bef73c82 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 10 Jan 2009 17:59:43 +0100 Subject: [PATCH] Even for srclen == 0 we have to return something This fixes a regression reported by Corinna Vinschen Thanks, Volker --- source/lib/charcnv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c index 3ec32209008..c3b345142f5 100644 --- a/source/lib/charcnv.c +++ b/source/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; } -- 2.11.4.GIT