summaryrefslogtreecommitdiff
path: root/source3/lib/charcnv.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/charcnv.c')
-rw-r--r--source3/lib/charcnv.c8
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)