git.samba.org
/
obnox
/
samba-ctdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d50a487
)
Even for srclen == 0 we have to return something
author
Volker Lendecke
<vl@samba.org>
Sat, 10 Jan 2009 16:59:43 +0000
(17:59 +0100)
committer
Volker Lendecke
<vl@samba.org>
Mon, 12 Jan 2009 09:50:14 +0000
(10:50 +0100)
This fixes a regression reported by Corinna Vinschen <corinna@vinschen.de>
Thanks,
Volker
source/lib/charcnv.c
patch
|
blob
|
history
diff --git
a/source/lib/charcnv.c
b/source/lib/charcnv.c
index f4efcb2ce23763f3817c9f5bdbd852656db57e6f..e51c33d7cd679c684435205f1212b294b0c021a4 100644
(file)
--- 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;
}