diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/charcnv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 1c6058a43e..5f9392b620 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -940,6 +940,10 @@ size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_ src_len &= ~1; ret = convert_string(CH_UCS2, CH_UNIX, src, src_len, dest, dest_len); + + if (src_len == (size_t)-1) + src_len = ret*2; + if (dest_len) dest[MIN(ret, dest_len-1)] = 0; else |