diff options
author | Jeremy Allison <jra@samba.org> | 2007-09-17 10:50:59 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:30:50 -0500 |
commit | 4f051e735b85a24f37e2b844bcbb348f36600420 (patch) | |
tree | 1d66e87be6e3c5bf16f7b63e68fbc8b7a3206ee9 /source3/lib | |
parent | ad97bcf813d5f06df4711896eefc99c0c32651cc (diff) | |
download | samba-4f051e735b85a24f37e2b844bcbb348f36600420.tar.gz samba-4f051e735b85a24f37e2b844bcbb348f36600420.tar.bz2 samba-4f051e735b85a24f37e2b844bcbb348f36600420.zip |
r25195: Fix issue with calling pull_uc2_*alloc with
str_len == 0. We should just return 0 in this
case.
Jeremy.
(This used to be commit 8bb85f3f141f0f45b06d28f004cb2cf18252d4e1)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/charcnv.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index a8fb95df06..9e669a1c9c 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -1369,6 +1369,10 @@ size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_ { size_t ret; + if (!src_len) { + return 0; + } + if (dest_len == (size_t)-1) dest_len = sizeof(pstring); @@ -1446,6 +1450,10 @@ static size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx, } #endif + if (!src_len) { + return 0; + } + if (ucs2_align(base_ptr, src, flags)) { src = (const void *)((const char *)src + 1); if (src_len != (size_t)-1) |