summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-01-10 17:59:43 +0100
committerVolker Lendecke <vl@samba.org>2009-01-12 10:52:00 +0100
commitffb53c35748154081c1587b5f167721e32ff10f2 (patch)
treee7c8004c7536bcce656812c54a9d6d94854353eb /source3
parent5d19187d3d69fff5c9c7551782adc18b5669c263 (diff)
downloadsamba-ffb53c35748154081c1587b5f167721e32ff10f2.tar.gz
samba-ffb53c35748154081c1587b5f167721e32ff10f2.tar.bz2
samba-ffb53c35748154081c1587b5f167721e32ff10f2.zip
Even for srclen == 0 we have to return something
This fixes a regression reported by Corinna Vinschen <corinna@vinschen.de> Thanks, Volker
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/charcnv.c6
1 files changed, 6 insertions, 0 deletions
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;
}